so if i do
printf("param->List %p", param->List ) ;
printf("m_List %p", m_List ) ;
befor the execution of Class2->Init();
I will receive
Output: 0034a
Output: 0034a
After execution of Class2->Init();
I will receive
Output: 00000
Output: 0034a
Miros,
The first thing I have learned on C++ is that when you use the new Statement the memory allocated by it will be NEVER freed until a delete statement.
Even if in place of
ThreadParam * param = new ThreadParam();
I will put a Class1 variable with the name m_ThreadParam like:
ThreadParam *...
Thanks for the fast answer!
param->List is a pointer to a list (the std template list) that is a private member of Class1, and myFlag is the last member of the Class2.
I'm realy don't know what is happening with my code, I'm doing a legal memory allocation on one variable and the VC++ 6.0 simply create another variable on the same memory space.
The program is very large and I will not post the whole program, I will try to post the relevant part of the code...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.