Skip to content

Commit 0db0985

Browse files
calsys456zccrs
authored andcommitted
fix: fix ddm crash on treeland crash
The problem is caused by reckless cleanup process. Check those pointers carefully to make reconnection works.
1 parent 6376608 commit 0db0985

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/daemon/TreelandConnector.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,16 @@ void TreelandConnector::connect(QString socketPath) {
220220

221221
void TreelandConnector::disconnect() {
222222
if (m_display) {
223-
m_notifier->setEnabled(false);
223+
if (m_notifier)
224+
m_notifier->setEnabled(false);
224225
wl_display_disconnect(m_display);
225-
delete m_notifier;
226+
if (m_notifier) {
227+
m_notifier->deleteLater();
228+
m_notifier = nullptr;
229+
}
230+
m_display = nullptr;
226231
}
232+
m_ddm = nullptr;
227233
}
228234

229235
// Request wrapper

0 commit comments

Comments
 (0)