[android-developers] how to get reference to GLSurfaceView's rendering thread?
I'd like to call join() on it to make sure the thread has exited.
(Broader context for those interested: I have a crash in my GL-based
app that happens like this:
- device is put to sleep with my app in the foreground
- an incoming call wakes the device up
- I receive onResume() and I call onResume() on my GLSurfaceView
- I receive onPause() almost immediately after onResume() since the
phone app goes to the background due to the incoming call
- the time between onResume() and onPause() is rather short but enough
for GLSurfaceView to go through all of its setup up to and including
the initial onDrawFrame() call
- my onDrawFrame() goes into texture & geometry loading routine which
can take up to several seconds so it's still loading when onPause() is
called as mentioned previously
- like many people here I have a globally-accessible method of
retrieving a reference to my main Activity to be used as the current
Context. This is used while loading graphics data to read asset
files.
- this Context reference however gets nulled out in onPause() in an
attempt not to leak main Activity instances. As the main thread
running onPause() nulls it while the rendering thread is still needing
it to finish loading the program crashes.
The idea is to call GLSurfaceView.onPause() and then wait until the
rendering thread actually exit. Then null the Context reference.)
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home