Memory Leaks - HELP REALY NEEDED
-
Hello, i have a class for flicker-free-drawing, there i have a global pointer to CBitmap, and in the constructor i create a CBitamp-Object via new. In the destructor i would like to delete the object, but my destructor is never called. When i exit my programm the debugger print "Detecting Memory Leaks!" and then the adress of the pointer to the CBitmap object. What can i do? When called windows/Visual c++ the destructor? Please help me!
-
Hello, i have a class for flicker-free-drawing, there i have a global pointer to CBitmap, and in the constructor i create a CBitamp-Object via new. In the destructor i would like to delete the object, but my destructor is never called. When i exit my programm the debugger print "Detecting Memory Leaks!" and then the adress of the pointer to the CBitmap object. What can i do? When called windows/Visual c++ the destructor? Please help me!
The order in which global variables are constructed and destructes is undefined. Therfore it might happen, that the CRT cleanup stuff is called before your destructor is executed and therefore a memory leak is reported. You should check this by adding a breakpoint to your destructer and see if it is reached. -- Daniel Lohmann http://www.losoft.de
-
The order in which global variables are constructed and destructes is undefined. Therfore it might happen, that the CRT cleanup stuff is called before your destructor is executed and therefore a memory leak is reported. You should check this by adding a breakpoint to your destructer and see if it is reached. -- Daniel Lohmann http://www.losoft.de
Hello Daniel, I have a breakpoint in the destructor, but the destructor is never called. My problem/question: i have this member-variable of my own class (in the header of a dialog, the member-variable is global): CMyOwnClass m_test; When i exit my programm the debugger print me a message "Detecting Memory Leaks!" with the adress of a CBitmap object. That CBitmap object create i via new i the constructor of CMyOwnClass. And i would like to delete the in the destructor. When call windows/visual c++ the destructor of CMyOwnClass? NEVER? Thank you for your reply!
-
Hello, i have a class for flicker-free-drawing, there i have a global pointer to CBitmap, and in the constructor i create a CBitamp-Object via new. In the destructor i would like to delete the object, but my destructor is never called. When i exit my programm the debugger print "Detecting Memory Leaks!" and then the adress of the pointer to the CBitmap object. What can i do? When called windows/Visual c++ the destructor? Please help me!
-
Hello Daniel, I have a breakpoint in the destructor, but the destructor is never called. My problem/question: i have this member-variable of my own class (in the header of a dialog, the member-variable is global): CMyOwnClass m_test; When i exit my programm the debugger print me a message "Detecting Memory Leaks!" with the adress of a CBitmap object. That CBitmap object create i via new i the constructor of CMyOwnClass. And i would like to delete the in the destructor. When call windows/visual c++ the destructor of CMyOwnClass? NEVER? Thank you for your reply!
Sorry, but this is not clear to me :confused: klm wrote: have this member-variable of my own class (in the header of a dialog, the member-variable is global): CMyOwnClass m_test; Ah, what the hell do you mean with a global member variable? It might help if you post some code (shrinked to the necessary stuff). -- Daniel Lohmann http://www.losoft.de
-
Sorry, but this is not clear to me :confused: klm wrote: have this member-variable of my own class (in the header of a dialog, the member-variable is global): CMyOwnClass m_test; Ah, what the hell do you mean with a global member variable? It might help if you post some code (shrinked to the necessary stuff). -- Daniel Lohmann http://www.losoft.de
Hello Daniel, with global member variable mean i: a variable in a class, that is accessable in each function of the class. I think the right word is: member variable. Sorry for my bad english and the "global member variable", but i come from C and i am new Visual C++, i don't have heard member varible before i started with Visual C++