]> Some of my projects - localmylist.git/commitdiff
SQLAsyncQuery fixes
authorAPTX <marek321@gmail.com>
Thu, 21 Mar 2013 12:58:13 +0000 (13:58 +0100)
committerAPTX <marek321@gmail.com>
Thu, 21 Mar 2013 12:58:13 +0000 (13:58 +0100)
localmylist/sqlasyncqueryinternal.cpp

index f4419c30a997ac0f37604f2d7021fd1a439dba0e..0753f41d8c4155da9e45c060d92db130449671a4 100644 (file)
@@ -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;
 }