Commit c1731493 authored by Jan Möbius's avatar Jan Möbius

Workaround for segfault on exit

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@9313 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c76bf19f
......@@ -625,6 +625,7 @@ Core::~Core()
for ( uint i = 0 ; i < loggers_.size(); ++i )
delete loggers_[i];
delete coreWidget_;
}
//-----------------------------------------------------------------------------
......@@ -857,6 +858,7 @@ Core::exitApplication()
QTimer* timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(slotExit()));
timer->start(100);
QApplication::quit();
}
......@@ -981,17 +983,20 @@ Core::writeOnExit() {
}
void Core::slotExit() {
// Write all information on application exit
writeOnExit();
// Call clearAll() before closing application
// in order to call all object's destructors...
clearAll();
// close the log file to ensure everything is writeen correctly
if (logFile_)
logFile_->close();
// Close the settings file
OpenFlipper::Options::closeSettings();
// Test if ini-file should be cleaned
// If so, delete it...
if(OpenFlipper::Options::deleteIniFile()) {
......@@ -1002,7 +1007,7 @@ void Core::slotExit() {
for ( int i = 0 ; i < (int)optionFiles.size(); ++i) {
success &= QFile::remove(optionFiles[i]);
}
if(!success) {
QMessageBox::warning(0, tr("Warning"),
tr("One or more files could not be removed.\nDelete files manually."),
......@@ -1011,6 +1016,9 @@ void Core::slotExit() {
}
}
// Cleanup the widgets here
delete coreWidget_;
qApp->quit();
}
......
......@@ -136,6 +136,19 @@ LoggerWidget::LoggerWidget( QWidget *parent)
}
LoggerWidget::~LoggerWidget()
{
delete clearButton_;
delete errorButton_;
delete warnButton_;
delete infoButton_;
delete allButton_;
delete scrollBar_;
delete context_;
delete list_;
}
//-------------------------------------------------------------------------------------
/// workaround for scrolling
......
......@@ -61,6 +61,8 @@ class LoggerWidget : public QWidget
public:
LoggerWidget( QWidget *parent = 0 );
~LoggerWidget();
/** \brief Append a new logmessage to log viewer
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment