From b2244ed9beaf90f3705b8dc94a253309ca2252b6 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Wed, 30 Sep 2015 00:44:06 +0200 Subject: [PATCH] Fix segfaults --- doorlockd/client/doorlock-client.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doorlockd/client/doorlock-client.cpp b/doorlockd/client/doorlock-client.cpp index 5762f4e..82e8906 100644 --- a/doorlockd/client/doorlock-client.cpp +++ b/doorlockd/client/doorlock-client.cpp @@ -155,11 +155,9 @@ int main(int argc, char** argv) // In normal operation, it never returns doorlock_client(hostname, port); + // This will stop the Qapplication mainWindow->hide(); - mainWindow.reset(); - - // Stop the QT application - app.quit(); + mainWindow->close(); }); // This routine will never return in normal operation @@ -167,6 +165,9 @@ int main(int argc, char** argv) clientThread.join(); + if (mainWindow) + mainWindow.reset(); + l(LogLevel::notice, "Stopping doorlock-client"); return 0; }