Re: [sqlite] sqlite3_prepare memory leak

2008-11-16 Thread Sherief N. Farouk
> Hi, > > Sherief, thank you for our kind help. You're welcome :). > I really did use globals. > I found a way to run DumpMemorLeaks after all globals and static > variables are deallocated, I used > _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); I should've RTFMed harder :(. >

Re: [sqlite] sqlite3_prepare memory leak

2008-11-05 Thread Bartosz Wiklak
Hi, Sherief, thank you for our kind help. I really did use globals. I found a way to run DumpMemorLeaks after all globals and static variables are deallocated, I used _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); I made some malloc and new leaks around the code I'm interested in

Re: [sqlite] sqlite3_prepare memory leak

2008-11-05 Thread Sherief N. Farouk
> I really don't see any way to use _CrtDumpMemoryLeaks(). It always > shows hundreds of blocks even if I'm sure that nothing was allocated > (no malloc or new). I know that this is not a place to learn how to > use VC++. Maybe it's true that Deleaker just freaks out. I will try to > track it

Re: [sqlite] sqlite3_prepare memory leak

2008-11-04 Thread Bartosz Wiklak
> Looks like the problem is from your app indeed. Again, what does > _CrtDumpMemoryLeaks() say? I really don't see any way to use _CrtDumpMemoryLeaks(). It always shows hundreds of blocks even if I'm sure that nothing was allocated (no malloc or new). I know that this is not a place to learn how

Re: [sqlite] sqlite3_prepare memory leak - OT

2008-11-04 Thread Sherief N. Farouk
> SQLite also does some "interesting" things with pointers. There are > a few areas of the code where an array of memory is allocated and > then the pointer is backed up a record (under-running the allocated > space) > to make the array 1-based rather than 0-based. All of the access is >

Re: [sqlite] sqlite3_prepare memory leak

2008-11-04 Thread Jay A. Kreibich
On Mon, Nov 03, 2008 at 10:07:46AM -0500, Sherief N. Farouk scratched on the wall: > 99% of the time the leaks are due to API abuse. Post a small sample app > (that build and runs) exhibiting the behavior, if possible. What does > _CrtDumpMemoryLeaks() say? SQLite also does some "interesting"

Re: [sqlite] sqlite3_prepare memory leak

2008-11-04 Thread Bartosz Wiklak
I figured up, that in my main app, when I don't make nested queries no memory leaks. In simple app no matter id I use nested or strait queries memory does not leak. For example: sprintf( lpbuf, "SELECT tagList FROM overlay WHERE modalityID=%d " "AND

Re: [sqlite] sqlite3_prepare memory leak

2008-11-04 Thread Bartosz Wiklak
Hi, I have written simple app that does the same query on the same database and I have no memory leaks !?! I build two apps with similar options (f.e. multithreaded debug dll) but my main app is written in winapi and "simple" app as console app. I have really no idea what can make these two act

Re: [sqlite] sqlite3_prepare memory leak

2008-11-03 Thread Sherief N. Farouk
> As you can see I use sqlite3_prepare/sqlite3_finalize pairs. My memory > leak checker ( Deleaker : www.deleaker.com ) reports memory leak at > sqlite3_prepare : > > msvcrt.dll!malloc > sqlite3.dll!sqlite3_malloc + 120 bytes > sqlite3.dll!sqlite3_realloc + 27 bytes >

[sqlite] sqlite3_prepare memory leak

2008-11-03 Thread Bartosz Wiklak
Hi, In my C++ application I'm writing/reading some blob data to the database. This is sample of my code (in 99% taken from example i found in the internet ): /** * This function reads one blob value asqued in zSql query into memory pointed by pzBlob * and returns size of allocated memory in