On 09/29/2011 08:30 AM, Ratamovic wrote:
>
> I am investigating the "static variable" subject and saw some
> discussions about it, e.g.:
> - http://groups.google.com/group/android-ndk/browse_thread/thread/23c1d511379cbc92
> - http://groups.google.com/group/android-ndk/browse_thread/thread/2530238bc9001809?pli=1
>
> Basically, it is claimed that Android can call onDestroy() after a new
> instance of the Activity has been created. This could lead to memory
> leaks and/or corruption as native code and its static global variables
> survive meanwhile and may get destroyed after being recreated.
> Hopefully there are a few solutions already indicated there.
Yes, as thoroughly described in the second thread that you mention, there is a
solution: don't use static variable. Or live with the consequences of your
design choice. It's nothing Android specific, it's just about code sanity.
Good luck
--
Olivier
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.