Skip to content

Commit 68f4e8b

Browse files
committed
chore(replay): Drop redundant cleanupScheduled guard
Cleanup body is already idempotent (screenshot.isRecycled check, MaskRenderer.close guards on isInitialized + isRecycled). A stray extra scheduleCleanup would just submit a no-op — not worth the AtomicBoolean.
1 parent 241129a commit 68f4e8b

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ internal class PixelCopyStrategy(
6060
private val unstableCaptures = AtomicInteger(0)
6161
private val isClosed = AtomicBoolean(false)
6262
private val frameInFlight = AtomicBoolean(false)
63-
private val cleanupScheduled = AtomicBoolean(false)
6463
private val dstOverPaint by
6564
lazy(NONE) { Paint().apply { xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OVER) } }
6665
private val screenshotCanvas by lazy(NONE) { Canvas(screenshot) }
@@ -383,9 +382,6 @@ internal class PixelCopyStrategy(
383382
}
384383

385384
private fun scheduleCleanup() {
386-
if (!cleanupScheduled.compareAndSet(false, true)) {
387-
return
388-
}
389385
val cleanup =
390386
ReplayRunnable(
391387
"PixelCopyStrategy.close",

0 commit comments

Comments
 (0)