Commit 7d28172a authored by Igor Demin's avatar Igor Demin

Fix native crash when we run tests on Windows

parent 06f7945c
......@@ -25,12 +25,6 @@ JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeGLContextNa
return reinterpret_cast<jlong>(GrDirectContext::MakeGL().release());
}
JNIEXPORT void JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_destroyContext(JNIEnv *env, jobject object, jlong contextPtr)
{
GrDirectContext *context = fromJavaPointer<GrDirectContext*>(contextPtr);
delete context;
}
extern void getMetalDeviceAndQueue(void** device, void** queue);
JNIEXPORT jlong JNICALL Java_org_jetbrains_skiko_RenderTargetsKt_makeMetalRenderTargetNative(
......
......@@ -24,5 +24,3 @@ external private fun makeGLContextNative(): Long
external private fun makeMetalRenderTargetNative(width: Int, height: Int, sampleCnt: Int): Long
external private fun makeMetalContextNative(): Long
external internal fun destroyContext(context: Long)
......@@ -6,7 +6,6 @@ import org.jetbrains.skija.SurfaceColorFormat
import org.jetbrains.skija.SurfaceOrigin
import org.jetbrains.skija.impl.Native
import org.jetbrains.skiko.SkiaLayer
import org.jetbrains.skiko.destroyContext
import org.jetbrains.skiko.redrawer.Direct3DRedrawer
import java.lang.ref.Reference
......@@ -66,9 +65,7 @@ internal class Direct3DContextHandler(layer: SkiaLayer) : ContextHandler(layer)
}
override fun destroyContext() {
if (context != null) {
destroyContext(Native.getPtr(context!!))
}
context?.close()
if (device != 0L) {
directXRedrawer.disposeDevice(device)
}
......
......@@ -6,7 +6,6 @@ import org.jetbrains.skija.SurfaceColorFormat
import org.jetbrains.skija.SurfaceOrigin
import org.jetbrains.skija.impl.Native
import org.jetbrains.skiko.SkiaLayer
import org.jetbrains.skiko.destroyContext
import org.jetbrains.skiko.redrawer.MetalRedrawer
internal class MetalContextHandler(layer: SkiaLayer) : ContextHandler(layer) {
......@@ -52,8 +51,6 @@ internal class MetalContextHandler(layer: SkiaLayer) : ContextHandler(layer) {
}
override fun destroyContext() {
if (context != null) {
destroyContext(Native.getPtr(context!!))
}
context?.close()
}
}
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