Repository navigation
IllegalStateException: SkiaLayer is disposed - in 1.0.0-rc2 #1448
Copy link
Copy link
Closed
Labels
Milestone
Description
This is happening in Aurora when I dispose a ComposeWindow used to display popup content
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: SkiaLayer is disposed
at org.jetbrains.skiko.SkiaLayer.needRedraw(SkiaLayer.jvm.kt:408)
at androidx.compose.ui.awt.ComposeLayer$scene$1.invoke(ComposeLayer.desktop.kt:103)
at androidx.compose.ui.awt.ComposeLayer$scene$1.invoke(ComposeLayer.desktop.kt:103)
at androidx.compose.ui.ComposeScene.invalidateIfNeeded(ComposeScene.skiko.kt:125)
at androidx.compose.ui.ComposeScene.access$invalidateIfNeeded(ComposeScene.skiko.kt:80)
at androidx.compose.ui.ComposeScene.sendPointerEvent-Kr8mkKM(ComposeScene.skiko.kt:572)
at androidx.compose.ui.ComposeScene.sendPointerEvent-Kr8mkKM$default(ComposeScene.skiko.kt:392)
at androidx.compose.ui.awt.ComposeLayer_desktopKt.onMouseEvent(ComposeLayer.desktop.kt:363)
at androidx.compose.ui.awt.ComposeLayer_desktopKt.access$onMouseEvent(ComposeLayer.desktop.kt:1)
at androidx.compose.ui.awt.ComposeLayer$onMouseEvent$1$1.invoke(ComposeLayer.desktop.kt:285)
at androidx.compose.ui.awt.ComposeLayer$onMouseEvent$1$1.invoke(ComposeLayer.desktop.kt:284)
at androidx.compose.ui.awt.ComposeLayer.catchExceptions(ComposeLayer.desktop.kt:93)
at androidx.compose.ui.awt.ComposeLayer.access$catchExceptions(ComposeLayer.desktop.kt:69)
at androidx.compose.ui.awt.ComposeLayer$onMouseEvent$1.invoke(ComposeLayer.desktop.kt:284)
at androidx.compose.ui.awt.ComposeLayer$onMouseEvent$1.invoke(ComposeLayer.desktop.kt:283)
at androidx.compose.ui.awt.AWTDebounceEventQueue$job$1.invokeSuspend(AWTDebounceEventQueue.desktop.kt:59)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Reactions are currently unavailable
Activity
kirill-grouchnikov commentedon Nov 23, 2021
Reproducer:
kirill-grouchnikov commentedon Nov 23, 2021
Click on the red square in the window. That creates a
ComposeWindowwith a blue box. Click that box to close the "popup" window and observe the stack tracekirill-grouchnikov commentedon Nov 23, 2021
Same in rc3
Fix disposing window in event callback
kirill-grouchnikov commentedon Nov 25, 2021
In 1.0.0-rc4 I now have this:
kirill-grouchnikov commentedon Nov 25, 2021
Same demo. It doesn't happen every time the blue box in a popup window is clicked to close it, but happens frequently enough if you keep on clicking the red and then the blue
Fix crash when AWT event is sent after the window is disposed
igordmn commentedon Nov 26, 2021
Should be fixed in 1.0.0-rc5. Thanks for the reports :)
kirill-grouchnikov commentedon Nov 26, 2021
Confirming the fixes in rc5
Events
Get rid of async
Desktop. Remove scheduling events on the next event loop frame
Desktop. Remove scheduling events on the next event loop frame
Desktop. Fix crash when we close the window inside an event handler
Desktop. Remove scheduling events on the next event loop frame
Desktop. Fix crash when we close the window inside an event handler
okushnikov commentedon Jul 14, 2024
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Desktop. Remove scheduling events on the next event loop frame
Desktop. Fix crash when we close the window inside an event handler