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() ...@@ -625,6 +625,7 @@ Core::~Core()
for ( uint i = 0 ; i < loggers_.size(); ++i ) for ( uint i = 0 ; i < loggers_.size(); ++i )
delete loggers_[i]; delete loggers_[i];
delete coreWidget_;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -857,6 +858,7 @@ Core::exitApplication() ...@@ -857,6 +858,7 @@ Core::exitApplication()
QTimer* timer = new QTimer(); QTimer* timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(slotExit())); connect(timer, SIGNAL(timeout()), this, SLOT(slotExit()));
timer->start(100); timer->start(100);
QApplication::quit(); QApplication::quit();
} }
...@@ -981,17 +983,20 @@ Core::writeOnExit() { ...@@ -981,17 +983,20 @@ Core::writeOnExit() {
} }
void Core::slotExit() { void Core::slotExit() {
// Write all information on application exit
writeOnExit(); writeOnExit();
// Call clearAll() before closing application // Call clearAll() before closing application
// in order to call all object's destructors... // in order to call all object's destructors...
clearAll(); clearAll();
// close the log file to ensure everything is writeen correctly
if (logFile_) if (logFile_)
logFile_->close(); logFile_->close();
// Close the settings file
OpenFlipper::Options::closeSettings(); OpenFlipper::Options::closeSettings();
// Test if ini-file should be cleaned // Test if ini-file should be cleaned
// If so, delete it... // If so, delete it...
if(OpenFlipper::Options::deleteIniFile()) { if(OpenFlipper::Options::deleteIniFile()) {
...@@ -1002,7 +1007,7 @@ void Core::slotExit() { ...@@ -1002,7 +1007,7 @@ void Core::slotExit() {
for ( int i = 0 ; i < (int)optionFiles.size(); ++i) { for ( int i = 0 ; i < (int)optionFiles.size(); ++i) {
success &= QFile::remove(optionFiles[i]); success &= QFile::remove(optionFiles[i]);
} }
if(!success) { if(!success) {
QMessageBox::warning(0, tr("Warning"), QMessageBox::warning(0, tr("Warning"),
tr("One or more files could not be removed.\nDelete files manually."), tr("One or more files could not be removed.\nDelete files manually."),
...@@ -1011,6 +1016,9 @@ void Core::slotExit() { ...@@ -1011,6 +1016,9 @@ void Core::slotExit() {
} }
} }
// Cleanup the widgets here
delete coreWidget_;
qApp->quit(); qApp->quit();
} }
......
...@@ -136,6 +136,19 @@ LoggerWidget::LoggerWidget( QWidget *parent) ...@@ -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 /// workaround for scrolling
......
...@@ -61,6 +61,8 @@ class LoggerWidget : public QWidget ...@@ -61,6 +61,8 @@ class LoggerWidget : public QWidget
public: public:
LoggerWidget( QWidget *parent = 0 ); LoggerWidget( QWidget *parent = 0 );
~LoggerWidget();
/** \brief Append a new logmessage to log viewer /** \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