|
-
June 9th, 2009, 05:03 PM
#1
destructors
Hi,
I have a hierarchical design of a class, say: BaseProcess, ....., MyXXXProcess.
The most derived class is not given a destructor. In this class, I m creating a array of another class, say MyClass, using pointers and new operator.
I wonder if the lack of destructor will create memory issues because I m not able to destroy the instances of MyClass that were created with the new operator.
If, instead I create the instances of MyClass as follows: MyClass obj1, obj2;
I guess in this case I dont need to worry about deleting the objects as they are created in stack and are released when the object goes out of scope. Is that correct?
Thanks,
sgiri
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|