i have a question regarding memory leakage.
i have a attribute defined in the class like this:
function1 is invoked when the application starts, and allocates memory for myObject:
function2 is latter ran, and does the following:
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 :)
>does this lead to memory leakage?
>do i have to explicitly delete myObject
If you're re-assigning the only pointer you have to it, yes.
>or can i do as i have done?
Nothing stopping you (unless you run out of memory), but if people see your code they may make fun of you.