From 585079a7666f3239f9c6fa1ce4ac3e07cd21dacc Mon Sep 17 00:00:00 2001 From: Bai Jing Date: Wed, 6 Jun 2012 17:04:31 +0200 Subject: fix jsondb-client doesn't quit properly When quiting while the thread is not running, it waits there forever This causes jsondb-client doesn't quit when it receives "quit" command Bug: 3539 Change-Id: Ibc4b6374c4faca0424a9ebb1a4b5a259b3572c73 Reviewed-by: Denis Dzyubenko --- tools/jsondb-client/client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/jsondb-client/client.cpp b/tools/jsondb-client/client.cpp index 1e5e55d5..dcdf9398 100644 --- a/tools/jsondb-client/client.cpp +++ b/tools/jsondb-client/client.cpp @@ -218,8 +218,8 @@ Client::Client( QObject *parent ) : Client::~Client() { - if (mInputThread) { - mInputThread->terminate(); + if (mInputThread && mInputThread->isRunning()) { + mInputThread->quit(); mInputThread->wait(1000); delete mInputThread; mInputThread = 0; -- cgit v1.2.3