Possible duplicate:
throwing object exceptions on the stack, memory leak with new?
Are you making exceptions in C ++ with or without the new operator? Because both of them cause an exception.
void KillUnicorns() { throw IllegalActionException(); } int main() { try { KillUnicorns(); } catch (IllegalActionException e) {
Although the following example will be a memory leak?
void KillUnicorns() { throw new IllegalActionException(); } int main() { try { KillUnicorns(); } catch (IllegalActionException* e) {
What is the correct way to throw exceptions in C ++?
c ++ memory-leaks exception exception-handling
Kevin
source share