Or to simply not release the same resource twice. That is clearly a bug - the control flow in your application is incorrect if it does this. You could work around it with the NULL value hack if you're short on time, but I recommend trying to find out why this happens since bugs like these might come back and bite you in the ass when you least expect it...

Robert Simpson wrote:
You can't.  The memory pStmt points to is freed and invalid after the call
to finalize.  Worse, that freed memory could've already been reallocated for
some other purpose by the time the call to finalize() returns control to
you.

So your solution is to NULL your pointer after calling finalize() and don't
call finalize() again if your pointer is NULL.

Robert



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Joanne Pham
Sent: Thursday, September 18, 2008 8:44 AM
To: General Discussion of SQLite Database
Subject: Re: [sqlite] Program is crashed on sqlite3_finalize(pStmt);

Hi All,
How to check if the pStmt is not finalize so sqlite3_finalize(pStmt) can be call again. I think I called
sqlite3_finalize(pStmt) twice so my application is crashed.
Thanks,
JP

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to