Skip to content

Commit 10da626

Browse files
committed
Cleanup
1 parent c5de3e0 commit 10da626

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

sentry-android-replay/src/main/java/io/sentry/android/replay/screenshot/CanvasStrategy.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,12 @@ internal class CanvasStrategy(
128128

129129
val surface = holder.reader.surface
130130
val canvas = surface.lockHardwareCanvas()
131-
canvas.drawColor(Color.BLACK, PorterDuff.Mode.CLEAR)
132-
holder.picture.draw(canvas)
133-
surface.unlockCanvasAndPost(canvas)
131+
try {
132+
canvas.drawColor(Color.BLACK, PorterDuff.Mode.CLEAR)
133+
holder.picture.draw(canvas)
134+
} finally {
135+
surface.unlockCanvasAndPost(canvas)
136+
}
134137
} catch (t: Throwable) {
135138
freePictureRef.set(holder)
136139
options.logger.log(SentryLevel.ERROR, "Canvas Strategy: picture render failed", t)

sentry-android-replay/src/main/java/io/sentry/android/replay/screenshot/PixelCopyStrategy.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ internal class PixelCopyStrategy(
5252

5353
@SuppressLint("NewApi")
5454
override fun capture(root: View) {
55-
contentChanged.set(false)
56-
5755
val window = root.phoneWindow
5856
if (window == null) {
5957
options.logger.log(DEBUG, "Window is invalid, not capturing screenshot")

0 commit comments

Comments
 (0)