i have a question regarding memory leakage.
i have a attribute defined in the class like this:
MyClass* myObject;
function1 is invoked when the application starts, and allocates memory for myObject:
myObject=new MyClass(1);
function2 is latter ran, and does the following:
myObject=new MyClass(2);
does this lead to memory leakage? do i have to explicitly delete myObject first and then allocate memory for myObject once again? or can i do as i have done? (it is important for me that the object keeps the original name!).
thank you