Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a65c3d

Browse files
rhermanklinkdpgeorge
authored andcommitted
unix-ffi/sqlite3: Fix statements not being finalized.
Currently, statements are only finalized upon a call to Cursor.close().However, in Cursor.execute() new statements get created without theprevious statements being finalized, causing those to get leaked,preventing the database from being closed. The fix addresses this byfinalizing the previous statement if it exists.Signed-off-by: Robert Klink <rhermanklink@ripe.net>
1 parent8d6ebf5 commit0a65c3d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎unix-ffi/sqlite3/sqlite3.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def __init__(self, h):
8484
self.stmnt=None
8585

8686
defexecute(self,sql,params=None):
87+
ifself.stmnt:
88+
# If there is an existing statement, finalize that to free it
89+
res=sqlite3_finalize(self.stmnt)
90+
check_error(self.h,res)
91+
8792
ifparams:
8893
params= [quote(v)forvinparams]
8994
sql=sql%tuple(params)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp