File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,7 @@ public final class ViewRootImpl implements ViewParent,
230230 boolean mHasHadWindowFocus ;
231231 boolean mLastWasImTarget ;
232232 boolean mWindowsAnimating ;
233+ boolean mIsDrawing ;
233234 int mLastSystemUiVisibility ;
234235
235236 // Pool of queued input events.
@@ -2037,10 +2038,12 @@ private void performDraw() {
20372038 final boolean fullRedrawNeeded = mFullRedrawNeeded ;
20382039 mFullRedrawNeeded = false ;
20392040
2041+ mIsDrawing = true ;
20402042 Trace .traceBegin (Trace .TRACE_TAG_VIEW , "draw" );
20412043 try {
20422044 draw (fullRedrawNeeded );
20432045 } finally {
2046+ mIsDrawing = false ;
20442047 Trace .traceEnd (Trace .TRACE_TAG_VIEW );
20452048 }
20462049
@@ -3962,7 +3965,12 @@ public void die(boolean immediate) {
39623965 if (immediate ) {
39633966 doDie ();
39643967 } else {
3965- destroyHardwareRenderer ();
3968+ if (!mIsDrawing ) {
3969+ destroyHardwareRenderer ();
3970+ } else {
3971+ Log .e (TAG , "Attempting to destroy the window while drawing!\n " +
3972+ " window=" + this + ", title=" + mWindowAttributes .getTitle ());
3973+ }
39663974 mHandler .sendEmptyMessage (MSG_DIE );
39673975 }
39683976 }
You can’t perform that action at this time.
0 commit comments