App crashes on exit - libc++abi.dylib: terminate called throwing an exception

Hi all!

Having some trouble exiting an App.
When i press the home button to exit the app i get this strange error on this function:

  
void ofAppiPhoneWindow::startAppWithDelegate(string appDelegateClassName) {  
    if( bAppCreated )  
        return;  
      
    bAppCreated = true;  
      
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];  
    UIApplicationMain(nil, nil, nil, [[[NSString alloc] initWithCString: appDelegateClassName.c_str()] autorelease]);   
    [pool release];  
}  

The error is on line 8.
And this message in the terminal “libc++abi.dylib: terminate called throwing an exception”

I’m not sure but I think that this started to happen when i add some png files to my app, i’ve already wrote a function that unload all the graphics when exiting, in case of a memory leak but with no successes.

The problem is that i can’t open the app again in the iPad, i have to build and run it again!
Can’t find any topic on the forum about this. Anyone knows what’s happening?

thanks in advance.
dot

this error usually tells you that you are doing something wrong with your memory management, either you are not releasing objects like sounds inside your destructor or testApp::exit(), or… you are trying to release something that is already released… probably something to do with sound.

Thanks kkkkkkkk.
Tried it with the new 0.74 version and now it works fine, but i’m going to checkout the memory management.

cheers

Hey all,

I’m having the same problem but I would really like to see how to debug this issue.

I’m running v_0.7.4 for iOS as well.

I’m putting a link of my project here. https://github.com/patinoart/rfeAppsDev/tree/master/rfeiosNativeJASidePanels

could be this?
http://forum.openframeworks.cc/t/app-crashing-upon-exit,-argh-help-:/12205/6

see link to that solution
https://github.com/openframeworks/openFrameworks/blob/master/addons/ofxiPhone/src/sound/ofxOpenALSoundPlayer.cpp