app/internal/window: [Android] skip redraw for destroyed views

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-13 14:31:21 +02:00
parent fda6fbcf84
commit 65d9a9d1f1
+4
View File
@@ -369,6 +369,10 @@ func (w *window) SetAnimating(anim bool) {
w.mu.Unlock()
if anim {
w.runOnMain(func(env *C.JNIEnv) {
if w.view == 0 {
// View was destroyed while switching to main thread.
return
}
callVoidMethod(env, w.view, w.mpostFrameCallback)
})
}