From 2085e169002e99c965481cd64ff9d6fc1e281419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 13 Jun 2013 16:55:55 +0200 Subject: [PATCH] fixed crash closing YACReaderLibrary after using the server (improved shutdown) --- YACReaderLibrary/main.cpp | 8 +++++++- YACReaderLibrary/server/startup.cpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/main.cpp b/YACReaderLibrary/main.cpp index d8f29006..dbcff307 100644 --- a/YACReaderLibrary/main.cpp +++ b/YACReaderLibrary/main.cpp @@ -49,5 +49,11 @@ int main( int argc, char ** argv ) /*mw->resize(800,480); mw->showMaximized();*/ - return app.exec(); + int ret = app.exec(); + + //server shutdown + s->stop(); + delete s; + + return ret; } diff --git a/YACReaderLibrary/server/startup.cpp b/YACReaderLibrary/server/startup.cpp index b8599dc7..5f33207a 100644 --- a/YACReaderLibrary/server/startup.cpp +++ b/YACReaderLibrary/server/startup.cpp @@ -64,7 +64,7 @@ void Startup::start() { void Startup::stop() { qDebug("ServiceHelper: Service has been stopped"); // QCoreApplication destroys all objects that have been created in start(). - listener->close(); + delete listener; }