From: APTX Date: Thu, 21 Mar 2013 12:58:13 +0000 (+0100) Subject: SQLAsyncQuery fixes X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=1cef6d5a5c6a988eb4785ad6ee97f9a117c6a2f4;p=localmylist.git SQLAsyncQuery fixes --- diff --git a/localmylist/sqlasyncqueryinternal.cpp b/localmylist/sqlasyncqueryinternal.cpp index f4419c3..0753f41 100644 --- a/localmylist/sqlasyncqueryinternal.cpp +++ b/localmylist/sqlasyncqueryinternal.cpp @@ -29,10 +29,10 @@ bool SqlAsyncQueryInternal::prepare(const QString &query) return false; } - if (q) - delete q; + if (!q) + q = new AsyncQuery; - q = new AsyncQuery; + q->boundValues.clear(); q->query = query; return true; @@ -57,6 +57,8 @@ bool SqlAsyncQueryInternal::exec() { if (working) return false; + if (!q) + return false; working = true; @@ -134,6 +136,8 @@ void SqlAsyncQueryInternal::finish() if (result) delete result; + result = 0; + currentRow = -1; }