summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Matyushin <[email protected]>2015-11-06 14:56:05 +0300
committerVyacheslav Matyushin <[email protected]>2015-11-06 14:56:05 +0300
commitfedacb685dcf1355afe6943ae2106bc7900f98ae (patch)
tree84e33ffab5f567d97a4b3d5f6a4e598440c1d2b5
parent66174edce3964d1bff34341f9a5d387ea8deebfe (diff)
Fixed a crash upon shutdown.
-rw-r--r--src/mainWindow.cpp3
-rw-r--r--src/tabLogViewsWidget.cpp8
2 files changed, 8 insertions, 3 deletions
diff --git a/src/mainWindow.cpp b/src/mainWindow.cpp
index 63aa348..a0d9fd6 100644
--- a/src/mainWindow.cpp
+++ b/src/mainWindow.cpp
@@ -496,6 +496,9 @@ void MainWindow::changeCurrentTab()
LogManager *currentManager = d->tabs->activeLogManager();
+ if (!currentManager)
+ return;
+
// If the tab changed, the selection changes too
updateSelection();
diff --git a/src/tabLogViewsWidget.cpp b/src/tabLogViewsWidget.cpp
index 28e6a3e..a5429e2 100644
--- a/src/tabLogViewsWidget.cpp
+++ b/src/tabLogViewsWidget.cpp
@@ -155,7 +155,10 @@ TabLogManager *TabLogViewsWidget::activeTabLogManager()
LogManager *TabLogViewsWidget::activeLogManager()
{
- return activeTabLogManager()->logManager();
+ TabLogManager *tabLogManager = activeTabLogManager();
+ if (tabLogManager)
+ return tabLogManager->logManager();
+ return nullptr;
}
LogManager *TabLogViewsWidget::createTab()
@@ -228,8 +231,7 @@ TabLogManager *TabLogViewsWidget::newTabLogManager()
LogManager *logManager = new LogManager(view);
// Signals from LogManager to Main Class
- connect(logManager, &LogManager::tabTitleChanged, this,
- &TabLogViewsWidget::changeTab);
+ connect(logManager, &LogManager::tabTitleChanged, this, &TabLogViewsWidget::changeTab);
connect(logManager, &LogManager::logUpdated, this, &TabLogViewsWidget::changeTitleAddedLines);
TabLogManager *tabLogManager = new TabLogManager(logManager);