int ofRunMainLoop(){
	auto ret = mainLoop()->loop();
#if !defined(TARGET_ANDROID) && !defined(TARGET_OF_IOS)
	ofExitCallback();
#endif
	return ret;
}
//--------------------------------------
int ofRunApp(shared_ptr<ofBaseApp> app){
	mainLoop()->run(app);
	auto ret = ofRunMainLoop();
	app.reset();
#if !defined(TARGET_ANDROID) && !defined(TARGET_OF_IOS)
	ofExitCallback();
#endif
	return ret;
}
void
Java_cc_openframeworks_OFAndroid_onDestroy( JNIEnv*  env, jclass  thiz ){
	ofExitCallback();
}