Skip to content

Commit 8d25eab

Browse files
bradfitzAndroid Code Review
authored andcommitted
Merge "Releasing lock even if exception is thrown."
2 parents 56c4c44 + 93c5b6a commit 8d25eab

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)