Commit f56cfc92 authored by Igor Demin's avatar Igor Demin

Fix Splash example crash

We can close the window during onRender
parent 034e4087
......@@ -102,12 +102,13 @@ open class SkiaLayer : HardwareLayer() {
renderer?.onRender(canvas, pictureWidth, pictureHeight, nanoTime)
check(!isDisposed)
synchronized(pictureLock) {
picture?.instance?.close()
val picture = pictureRecorder.finishRecordingAsPicture()
this.picture = PictureHolder(picture, pictureWidth, pictureHeight)
// we can dispose layer during onRender
if (!isDisposed) {
synchronized(pictureLock) {
picture?.instance?.close()
val picture = pictureRecorder.finishRecordingAsPicture()
this.picture = PictureHolder(picture, pictureWidth, pictureHeight)
}
}
}
......
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