Make android save more robust
This commit is contained in:
parent
3ba403f30e
commit
e8cba9dc15
14 changed files with 61 additions and 33 deletions
|
|
@ -49,6 +49,7 @@ jstring string2jstring(JNIEnv* env, const std::string& s) {
|
|||
|
||||
namespace AndroidJNICalls {
|
||||
InputManager* globalInputManager;
|
||||
std::mutex globalMutex;
|
||||
|
||||
std::mutex textboxMutex;
|
||||
CustomEvents::InputTextBoxID textboxID = 0;
|
||||
|
|
@ -345,4 +346,12 @@ Java_com_erroratline0_infinipaint_InfiniPaintNetworkService_networkServiceDestro
|
|||
NetThreadManager::get().destroy_thread();
|
||||
}
|
||||
|
||||
#endif
|
||||
extern "C"
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_erroratline0_infinipaint_InfiniPaint_androidOnStop(JNIEnv *env, jclass clazz) {
|
||||
std::scoped_lock a{globalMutex};
|
||||
if(AndroidJNICalls::globalInputManager)
|
||||
AndroidJNICalls::globalInputManager->main.input_android_on_stop_callback();
|
||||
}
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue