@@ -33,6 +33,9 @@
34ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
34ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
35 : QGuiApplication(argc, argv)
35 : QGuiApplication(argc, argv)
36+ , m_shellView(nullptr)
37+ , m_secondaryWindow(nullptr)
38+ , m_mouseTouchAdaptor(nullptr)
38 setApplicationName(QStringLiteral("unity8"));
41 setApplicationName(QStringLiteral("unity8"));
@@ -116,12 +119,22 @@ ShellApplication::ShellApplication(int & argc, char ** argv, bool isMirServer)
118ShellApplication::~ShellApplication()
121ShellApplication::~ShellApplication()
126+void ShellApplication::destroyResources()
120 // Deletion order is important. Don't use QScopedPointers and the like
128 // Deletion order is important. Don't use QScopedPointers and the like
121 // Otherwise the process will hang on shutdown (bug somewhere I guess).
129 // Otherwise the process will hang on shutdown (bug somewhere I guess).
122 delete m_shellView;
130 delete m_shellView;
131+ m_shellView = nullptr;
123 delete m_secondaryWindow;
133 delete m_secondaryWindow;
134+ m_secondaryWindow = nullptr;
124 delete m_mouseTouchAdaptor;
136 delete m_mouseTouchAdaptor;
137+ m_mouseTouchAdaptor = nullptr;
127void ShellApplication::setupQmlEngine(bool isMirServer)
140void ShellApplication::setupQmlEngine(bool isMirServer)