Possible CDatabase Event Handle Leak 
Author Message
 Possible CDatabase Event Handle Leak

Hello,

I am working on a MFC SDI application that is leaking event handles. I
have verified this by using HandleEx.exe and task mangler. The
application itself spawns about 6 threads and creates 3 in process COM
objects ( call them A B and C), of which one (lets say B) spawns about
20 threads. Now A is used in B, C, and the main SDI application. The
only method for interface A uses CDatabase to open a connection to a
remote Sql server database, Executes a Sql insert command, and closes
its connection to the database ( its a logging interface so it can be
called fairly rapidly ). When I close the leaked handles forcefully
via HandleEx.exe I sometimes get a invalid handle crash, and mostly
the stack shows me down in sqlsvr32.dll or odbc?.dll. I've noticed
people getting leaks upon opening/closing a db connection, but mine is
random and not consistant as they described. These leaks can add up
after a few days of run time, enough that we have to restart the
application. Has anyone seen anything like this, and is it related to
the dabase code or am I barking up the wrong tree? Also, suggestions
on how to fix it would be nice.

Thanks for the help,

Chris



Sun, 30 Nov 2003 11:06:01 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Handle Leak with CDatabase

2. Handle leak, memory leak...

3. Possible misuse of CDatabase and CRecordSet

4. Help - Memory Leak Using CDatabase

5. Mem leaks with small ATL DLL using CDatabase

6. Mem leaks using CDatabase in ATL DLL

7. Mem Leaks with ATL DLL and CDatabase

8. Memory leak in CDatabase::Open()

9. CDatabase::OpenEx loads DLLs, leaks memory?

10. CDatabase memory leak

11. Mem leaks with small ATL DLL using CDatabase

12. Memory/Thread leak using CDatabase/CRecordset(s)

 

 
Powered by phpBB® Forum Software