]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/android/main.cpp
Use nullptr instead of 0 for pointers
[libs/core.git] / source / core / android / main.cpp
index 86ed5bed84572e0029b0f2cf35fe668bac866586..ff811c19dd4172ba51c98953b76f1976bb3cc8ac 100644 (file)
@@ -2,5 +2,10 @@
 
 extern "C" void ANativeActivity_onCreate(ANativeActivity *activity, void * /*saved_state*/, size_t /*state_size*/)
 {
-       new Msp::Android::MainThread(activity);
+       static Msp::Android::MainThread *thread = nullptr;
+       if(thread)
+               thread->attach_to_activity(activity);
+       else
+               thread = new Msp::Android::MainThread(activity);
+       thread->wait_for_app_created();
 }