Detected memory leaks! - How to get the point of memory leak and remove it
-
Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep
**Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long
:) Leave your mark wherever you go -
Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep
**Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long
:) Leave your mark wherever you goYou usually find the memory leak by simply clicking on the line reported say strcore.cpp(118) But, if that file resides out side your project, as strcore.cpp does (its part of MFC) it wont work. The second leak should "D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) " Double click it and it will take you to where it was allocated. As for the first, you have a leak via a CString somewhere.
-
Hi As usual i recd. following message on my build output window How to find the point of the memory leak and how to overcome it. Thanks a lot for any suggestion. Sandeep
**Detected memory leaks!** Dumping objects -> strcore.cpp(118) : {1639} normal block at 0x0063B6B0, 181 bytes long. Data: < ODBC> 01 00 00 00 A8 00 00 00 A8 00 00 00 4F 44 42 43 D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) : {1633} client block at 0x0063B900, subtype 0, 100 bytes long. a CDatabase object at $0063B900, 100 bytes long D:\Documents and Settings\erc\Desktop\Pattern\PatternDoc.cpp(508) : {1535} client block at 0x0063A180, subtype 0, 88 bytes long. a CObject object at $0063A180, 88 bytes long
:) Leave your mark wherever you goone way is dubble clicking on the line the other reading it.. first line says: strcore.cpp(118) etc etc etc says that the mem was allocated on line 118 of the strcore.cpp file...(but never deallocated) in your DBManager.cpp file line 32 you allocate memory that wasn^t deallocated same for PatternDoc.cpp line 508. as for in which situations that occurs... Debug!! put breakpoints and read carefull your new and delete statements! Regards, Davy
-
You usually find the memory leak by simply clicking on the line reported say strcore.cpp(118) But, if that file resides out side your project, as strcore.cpp does (its part of MFC) it wont work. The second leak should "D:\Documents and Settings\erc\Desktop\Pattern\DBManager.cpp(32) " Double click it and it will take you to where it was allocated. As for the first, you have a leak via a CString somewhere.
-
one way is dubble clicking on the line the other reading it.. first line says: strcore.cpp(118) etc etc etc says that the mem was allocated on line 118 of the strcore.cpp file...(but never deallocated) in your DBManager.cpp file line 32 you allocate memory that wasn^t deallocated same for PatternDoc.cpp line 508. as for in which situations that occurs... Debug!! put breakpoints and read carefull your new and delete statements! Regards, Davy