Skip to content

Commit

Permalink
Fix crash reading Canvas size from IO thread
Browse files Browse the repository at this point in the history
Fixes #2643
  • Loading branch information
pyricau committed Mar 26, 2024
1 parent 9472ff1 commit bfba641
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ internal class RenderHeapDumpScreen(

viewTreeObserver.addOnGlobalLayoutListener(object : OnGlobalLayoutListener {
override fun onGlobalLayout() {

// Extract values from the main thread, these could change by the time
// we get to the IO thread.
val measuredWidth = measuredWidth
val measuredHeight = measuredHeight
executeOnIo {
val bitmap = HeapDumpRenderer.render(
context, heapDumpFile, measuredWidth, measuredHeight, 0
Expand Down

0 comments on commit bfba641

Please sign in to comment.