on xenial help sign in
Another round of changes for fixing the hang on shutdown
commit400eb69ceb21713f0e42561a71b62ca751703d3d authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateTue 20 Oct 2015, 13:19 (11 years ago) parentffd336e
3 files changed+15−1
src/ShellApplication.cpp+13 src/ShellApplication.h+1 src/main.cpp+1−1
src/ShellApplication.cpp+13
@@ -33,6 +33,9 @@
3333
3434ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
3535 : QGuiApplication(argc, argv)
36+ , m_shellView(nullptr)
37+ , m_secondaryWindow(nullptr)
38+ , m_mouseTouchAdaptor(nullptr)
3639{
3740
3841 setApplicationName(QStringLiteral("unity8"));
@@ -116,12 +119,22 @@ ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
116119}
117120
118121ShellApplication::~ShellApplication()
122+{
123+ destroyResources();
124+}
125+
126+void ShellApplication::destroyResources()
119127{
120128 // Deletion order is important. Don't use QScopedPointers and the like
121129 // Otherwise the process will hang on shutdown (bug somewhere I guess).
122130 delete m_shellView;
131+ m_shellView = nullptr;
132+
123133 delete m_secondaryWindow;
134+ m_secondaryWindow = nullptr;
135+
124136 delete m_mouseTouchAdaptor;
137+ m_mouseTouchAdaptor = nullptr;
125138}
126139
127140void ShellApplication::setupQmlEngine(bool isMirServer)
src/ShellApplication.h+1
@@ -34,6 +34,7 @@ public:
3434 ShellApplication(int & argc, char ** argv, bool isMirServer);
3535 virtual ~ShellApplication();
3636
37+ void destroyResources();
3738public Q_SLOTS:
3839 // called by qtmir
3940 void onScreenAboutToBeRemoved(QScreen *screen);
src/main.cpp+1−1
@@ -29,7 +29,7 @@ int main(int argc, const char *argv[])
2929
3030 int result = application->exec();
3131
32− delete application;
32+ application->destroyResources();
3333
3434 return result;
3535}