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