Skip to content

Commit

Permalink
Merge pull request #2645 from square/py/measure_crash
Browse files Browse the repository at this point in the history
Fix crash reading Canvas size from IO thread
  • Loading branch information
pyricau committed Mar 26, 2024
2 parents 9472ff1 + bfba641 commit 0d178de
Showing 1 changed file with 4 additions and 1 deletion.
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 0d178de

Please sign in to comment.