MyClass func()
{
MyClass obj;
...
return obj;
}
The above code causes a segfault. I've found that the only way to fix it is to comment out my destructor. This leads me to believe that the destructor is being called on my obj, even though I'm returning it. Is there anyway I can NOT call the destructor in just this one instance? I can't simply keep the destructor lines commented out or it will cause memory leaks in other parts of the program.
Thank you for your help.

New Topic/Question
Reply



MultiQuote





|