C
Carlos Martinez
Hi all:
When in a class constructor an exception is thrown, the class must free
memory it has reserved during initialization.
But what about the memory reserved for a class itself.
Ex:
MyClass* myObject;
try {
myObject = new MyClass();
} catch(excepcion& e) {
...
}
If the constructor of MyClass throws an exception, does new return
memory that must be freed?
Thanks in advance
When in a class constructor an exception is thrown, the class must free
memory it has reserved during initialization.
But what about the memory reserved for a class itself.
Ex:
MyClass* myObject;
try {
myObject = new MyClass();
} catch(excepcion& e) {
...
}
If the constructor of MyClass throws an exception, does new return
memory that must be freed?
Thanks in advance