Commit f56cfc92 authored by Igor Demin's avatar Igor Demin

Fix Splash example crash

We can close the window during onRender
parent 034e4087
...@@ -102,14 +102,15 @@ open class SkiaLayer : HardwareLayer() { ...@@ -102,14 +102,15 @@ open class SkiaLayer : HardwareLayer() {
renderer?.onRender(canvas, pictureWidth, pictureHeight, nanoTime) renderer?.onRender(canvas, pictureWidth, pictureHeight, nanoTime)
check(!isDisposed) // we can dispose layer during onRender
if (!isDisposed) {
synchronized(pictureLock) { synchronized(pictureLock) {
picture?.instance?.close() picture?.instance?.close()
val picture = pictureRecorder.finishRecordingAsPicture() val picture = pictureRecorder.finishRecordingAsPicture()
this.picture = PictureHolder(picture, pictureWidth, pictureHeight) this.picture = PictureHolder(picture, pictureWidth, pictureHeight)
} }
} }
}
override fun draw() { override fun draw() {
check(!isDisposed) check(!isDisposed)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment