Commit 55c1cad7 authored by Roman Sedaikin's avatar Roman Sedaikin

Refactored the release of layer resources in Drawlayer.mm

parent b37b2c49
...@@ -45,9 +45,7 @@ fun SwingSkia() = SwingUtilities.invokeLater { ...@@ -45,9 +45,7 @@ fun SwingSkia() = SwingUtilities.invokeLater {
Button( Button(
text = "Fullscreen", text = "Fullscreen",
action = { action = {
if (panel != null) { panel.layer.fullscreen = !panel.layer.fullscreen
panel.layer.fullscreen = !panel.layer.fullscreen
}
} }
), ),
BorderLayout.NORTH BorderLayout.NORTH
......
...@@ -27,19 +27,18 @@ ...@@ -27,19 +27,18 @@
if (self) if (self)
{ {
self.canvasGlobalRef = NULL; self.canvasGlobalRef = NULL;
self.container = NULL; self.container = nil;
self.window = NULL; self.window = nil;
} }
return self; return self;
} }
- (void) disposeLayer:(JNIEnv *) env -(void) dealloc {
{
env->DeleteGlobalRef(self.canvasGlobalRef);
self.canvasGlobalRef = NULL; self.canvasGlobalRef = NULL;
self.container = NULL; [self.container release];
self.window = NULL; [self.window release];
[super dealloc];
} }
- (BOOL) isFullScreen { - (BOOL) isFullScreen {
...@@ -137,7 +136,7 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_nativeDispose(JNIE ...@@ -137,7 +136,7 @@ JNIEXPORT void JNICALL Java_org_jetbrains_skiko_HardwareLayer_nativeDispose(JNIE
if (layer != NULL) if (layer != NULL)
{ {
[layerStorage removeObject: layer]; [layerStorage removeObject: layer];
[layer disposeLayer: env]; env->DeleteGlobalRef(layer.canvasGlobalRef);
[layer release]; [layer release];
} }
} }
......
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