Skip to content

Commit

Permalink
Save settings earlier to avoid access to already deleted objects
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertKrajewski committed Jan 3, 2016
1 parent 651478b commit 1c66366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions mymainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ MyMainWindow::MyMainWindow(QWidget *parent):
}
}

MyMainWindow::~MyMainWindow()
void MyMainWindow::closeEvent(QCloseEvent * event)
{
saveSettings();
delete ui;
delete trayIcon;

QsLogging::Logger::destroyInstance();

event->accept();
}

/// Laden der gespeicherten Einstellungen aller Tabs
Expand Down
2 changes: 1 addition & 1 deletion mymainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MyMainWindow : public QMainWindow

public:
explicit MyMainWindow(QWidget *parent = 0);
~MyMainWindow();
void closeEvent(QCloseEvent * event);

private slots:
void trayClickedSlot(QSystemTrayIcon::ActivationReason);
Expand Down

0 comments on commit 1c66366

Please sign in to comment.