File tree 1 file changed +18
-16
lines changed
1 file changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -466,30 +466,32 @@ Statement::Ptr::Ptr(Ptr&& aPtr) :
466
466
aPtr.mpStmt = NULL ;
467
467
aPtr.mpRefCount = NULL ;
468
468
}
469
- #endif
469
+ #endif
470
470
471
471
/* *
472
472
* @brief Decrement the ref counter and finalize the sqlite3_stmt when it reaches 0
473
473
*/
474
474
Statement::Ptr::~Ptr ()
475
475
{
476
- assert (NULL != mpRefCount);
477
- assert (0 != *mpRefCount);
478
-
479
- // Decrement and check the reference counter of the sqlite3_stmt
480
- --(*mpRefCount);
481
- if (0 == *mpRefCount)
476
+ if (NULL != mpRefCount)
482
477
{
483
- // If count reaches zero, finalize the sqlite3_stmt, as no Statement nor Column objet use it anymore.
484
- // No need to check the return code, as it is the same as the last statement evaluation.
485
- sqlite3_finalize (mpStmt);
486
-
487
- // and delete the reference counter
488
- delete mpRefCount;
489
- mpRefCount = NULL ;
490
- mpStmt = NULL ;
478
+ assert (0 != *mpRefCount);
479
+
480
+ // Decrement and check the reference counter of the sqlite3_stmt
481
+ --(*mpRefCount);
482
+ if (0 == *mpRefCount)
483
+ {
484
+ // If count reaches zero, finalize the sqlite3_stmt, as no Statement nor Column objet use it anymore.
485
+ // No need to check the return code, as it is the same as the last statement evaluation.
486
+ sqlite3_finalize (mpStmt);
487
+
488
+ // and delete the reference counter
489
+ delete mpRefCount;
490
+ mpRefCount = NULL ;
491
+ mpStmt = NULL ;
492
+ }
493
+ // else, the finalization will be done later, by the last object
491
494
}
492
- // else, the finalization will be done later, by the last object
493
495
}
494
496
495
497
You can’t perform that action at this time.
0 commit comments