Fix: stack queue check

Now explicitly check the caller class
This commit is contained in:
khanhduytran0 committed 2023-07-30 12:06:55 +01:00
1 parent a8b137323c
commit 2ae408f5dd
3 files changed
+4 -4

No files matched your search

@@ -783,7 +783,8 @@ public class GLFW
if (!isGLFWReady) {
mGLFWInitialTime = (double) System.nanoTime();
long __functionAddress = Functions.Init;
isGLFWReady = invokeI(__functionAddress) != 0;
boolean isCalledFromLWJGLX = new Throwable().getStackTrace()[1].getClassName().equals("org.lwjgl.Sys");
isGLFWReady = invokeI(!isCalledFromLWJGLX, __functionAddress) != 0;
}
return isGLFWReady;
}
-2
View File
@@ -302,8 +302,6 @@ static AFURLSessionManager* manager;
library[@"downloads"][@"artifact"][@"path"] = @"net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar";
library[@"downloads"][@"artifact"][@"url"] = @"https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar";
library[@"downloads"][@"artifact"][@"sha1"] = @"1200e7ebeedbe0d10062093f32925a912020e747";
} else if ([library[@"name"] hasPrefix:@"org.lwjgl:lwjgl:"]) {
isUseStackQueueCall = [library[@"name"] hasPrefix:@"org.lwjgl:lwjgl:3"];
}
}
+2 -1
View File
@@ -209,8 +209,9 @@ void loadSymbolsVirGL() {
vtest_swap_buffers_p = dlsym(handle, "vtest_swap_buffers");
}
int pojavInit() {
int pojavInit(BOOL useStackQueue) {
isInputReady = 1;
isUseStackQueueCall = useStackQueue;
mainThreadID = gettid();
return JNI_TRUE;
}