1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

Fix a rare crash.

This commit is contained in:
srazi 2015-10-13 06:12:13 +03:30 committed by David Rosca
parent 1af76cb2a9
commit ac48237eca
2 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,6 @@ MainApplication::MainApplication(int &argc, char** argv)
, m_desktopNotifications(0)
, m_webProfile(0)
, m_autoSaver(0)
, m_lastActiveWindow(0)
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
, m_registerQAppAssociation(0)
#endif
@ -370,7 +369,7 @@ QList<BrowserWindow*> MainApplication::windows() const
BrowserWindow* MainApplication::getWindow() const
{
if (m_lastActiveWindow) {
return m_lastActiveWindow;
return m_lastActiveWindow.data();
}
return m_windows.isEmpty() ? 0 : m_windows.first();

View File

@ -21,6 +21,7 @@
#define mApp MainApplication::instance()
#include <QList>
#include <QPointer>
#include "qtsingleapplication/qtsingleapplication.h"
#include "restoremanager.h"
@ -173,7 +174,7 @@ private:
AutoSaver* m_autoSaver;
QList<BrowserWindow*> m_windows;
BrowserWindow* m_lastActiveWindow;
QPointer<BrowserWindow> m_lastActiveWindow;
QList<PostLaunchAction> m_postLaunchActions;