File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -373,14 +373,6 @@ stmt_dealloc(pysqlite_Statement *self)
373
373
{
374
374
PyTypeObject * tp = Py_TYPE (self );
375
375
PyObject_GC_UnTrack (self );
376
-
377
- if (self -> st ) {
378
- Py_BEGIN_ALLOW_THREADS
379
- sqlite3_finalize (self -> st );
380
- Py_END_ALLOW_THREADS
381
- self -> st = NULL ;
382
- }
383
-
384
376
tp -> tp_clear ((PyObject * )self );
385
377
tp -> tp_free (self );
386
378
Py_DECREF (tp );
@@ -389,6 +381,13 @@ stmt_dealloc(pysqlite_Statement *self)
389
381
static int
390
382
stmt_clear (pysqlite_Statement * self )
391
383
{
384
+ if (self -> st ) {
385
+ Py_BEGIN_ALLOW_THREADS
386
+ sqlite3_finalize (self -> st );
387
+ Py_END_ALLOW_THREADS
388
+ self -> st = 0 ;
389
+ }
390
+
392
391
Py_CLEAR (self -> sql );
393
392
if (self -> in_weakreflist != NULL ) {
394
393
PyObject_ClearWeakRefs ((PyObject * )self );
You can’t perform that action at this time.
0 commit comments