Skip to content

Commit 93c5b6a

Browse files
author
Jozef BABJAK
committed
Releasing lock even if exception is thrown.
However, the whole method needs to be reviewed. It still has several locking/unlocking places not tied together by try-finally construct, but they cannot be fixed without deeper understanding. Change-Id: Iaaf87568d585327654be409377b6d57a1da135eb
1 parent 7118bde commit 93c5b6a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/java/android/view/ViewRoot.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,10 +1065,11 @@ private void performTraversals() {
10651065
}
10661066
}
10671067
mSurfaceHolder.mSurfaceLock.lock();
1068-
// Make surface invalid.
1069-
//mSurfaceHolder.mSurface.copyFrom(mSurface);
1070-
mSurfaceHolder.mSurface = new Surface();
1071-
mSurfaceHolder.mSurfaceLock.unlock();
1068+
try {
1069+
mSurfaceHolder.mSurface = new Surface();
1070+
} finally {
1071+
mSurfaceHolder.mSurfaceLock.unlock();
1072+
}
10721073
}
10731074
}
10741075

0 commit comments

Comments
 (0)