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)
373373{
374374 PyTypeObject * tp = Py_TYPE (self );
375375 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-
384376 tp -> tp_clear ((PyObject * )self );
385377 tp -> tp_free (self );
386378 Py_DECREF (tp );
@@ -389,6 +381,13 @@ stmt_dealloc(pysqlite_Statement *self)
389381static int
390382stmt_clear (pysqlite_Statement * self )
391383{
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+
392391 Py_CLEAR (self -> sql );
393392 if (self -> in_weakreflist != NULL ) {
394393 PyObject_ClearWeakRefs ((PyObject * )self );
You can’t perform that action at this time.
0 commit comments