|
From: <eli...@us...> - 2007-11-14 11:07:26
|
Revision: 2921
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=2921&view=rev
Author: elias_naur
Date: 2007-11-14 03:07:22 -0800 (Wed, 14 Nov 2007)
Log Message:
-----------
openal: Don't free native path too early (duh)
Modified Paths:
--------------
trunk/LWJGL/src/native/linux/linux_al.c
trunk/LWJGL/src/native/macosx/macosx_al.c
trunk/LWJGL/src/native/windows/windows_al.c
Modified: trunk/LWJGL/src/native/linux/linux_al.c
===================================================================
--- trunk/LWJGL/src/native/linux/linux_al.c 2007-11-14 10:45:07 UTC (rev 2920)
+++ trunk/LWJGL/src/native/linux/linux_al.c 2007-11-14 11:07:22 UTC (rev 2921)
@@ -48,13 +48,13 @@
void tryLoadLibrary(JNIEnv *env, jstring path) {
char *path_str = GetStringNativeChars(env, path);
printfDebugJava(env, "Testing '%s'", path_str);
- free(path_str);
handleOAL = dlopen(path_str, RTLD_LAZY);
if (handleOAL != NULL) {
printfDebugJava(env, "Found OpenAL at '%s'", path_str);
} else {
throwException(env, "Could not load OpenAL library");
}
+ free(path_str);
}
void UnLoadOpenAL() {
Modified: trunk/LWJGL/src/native/macosx/macosx_al.c
===================================================================
--- trunk/LWJGL/src/native/macosx/macosx_al.c 2007-11-14 10:45:07 UTC (rev 2920)
+++ trunk/LWJGL/src/native/macosx/macosx_al.c 2007-11-14 11:07:22 UTC (rev 2921)
@@ -93,12 +93,12 @@
const char *path_str = (*env)->GetStringUTFChars(env, path, NULL);
printfDebugJava(env, "Testing '%s'", path_str);
handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
- (*env)->ReleaseStringUTFChars(env, path, path_str);
if (handleOAL != NULL) {
printfDebugJava(env, "Found OpenAL at '%s'", path_str);
} else {
throwException(env, "Could not load OpenAL library");
}
+ (*env)->ReleaseStringUTFChars(env, path, path_str);
}
/**
Modified: trunk/LWJGL/src/native/windows/windows_al.c
===================================================================
--- trunk/LWJGL/src/native/windows/windows_al.c 2007-11-14 10:45:07 UTC (rev 2920)
+++ trunk/LWJGL/src/native/windows/windows_al.c 2007-11-14 11:07:22 UTC (rev 2921)
@@ -55,12 +55,12 @@
char *path_str = GetStringNativeChars(env, path);
printfDebugJava(env, "Testing '%s'", path_str);
handleOAL = LoadLibrary(path_str);
- free(path_str);
if (handleOAL != NULL) {
printfDebugJava(env, "Found OpenAL at '%s'", path_str);
} else {
throwException(env, "Could not load OpenAL library (%d)", GetLastError());
}
+ free(path_str);
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|