From: Alexis Laferrière Date: Tue, 20 Jan 2015 19:25:26 +0000 (-0500) Subject: lib/android: pin the App instance being registered in C X-Git-Tag: v0.7.1~12 X-Git-Url: http://nitlanguage.org lib/android: pin the App instance being registered in C Signed-off-by: Alexis Laferrière --- diff --git a/lib/android/native_app_glue.nit b/lib/android/native_app_glue.nit index fc5a19f..af3c797 100644 --- a/lib/android/native_app_glue.nit +++ b/lib/android/native_app_glue.nit @@ -301,7 +301,10 @@ extern class NativeAppGlue `{ struct android_app* `} # We use the `userData` field of the C structure to store an handle to # the associated App private fun user_data: App `{ return recv->userData; `} - private fun user_data=(val: App) `{ recv->userData = val; `} + private fun user_data=(val: App) `{ + App_incr_ref(val); + recv->userData = val; + `} # Fill this in with the function to process input events. At this point # the event has already been pre-dispatched, and it will be finished upon