diff options
author | athomas <[email protected]> | 2003-11-19 00:30:26 +0000 |
---|---|---|
committer | athomas <[email protected]> | 2003-11-19 00:30:26 +0000 |
commit | e8d650a5cb1e3d80c266271d87788670718b895f (patch) | |
tree | 031cca1a335b7529087fcd739d761e322b27d1a3 /src/native | |
parent | 2b098f572821a7a4437c1243f73be1c2815c0cc8 (diff) |
Removed a redundant call to alcOpenDevice, Eliminated a call to ReleaseStringUTFChars in the event that null is passed in and added some instrumentation printouts to try to figure out what's causing this crash on people's systems (and not mine!)
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@60 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/alcbind.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/native/alcbind.c b/src/native/alcbind.c index d35f292..c598b04 100644 --- a/src/native/alcbind.c +++ b/src/native/alcbind.c @@ -43,15 +43,29 @@ JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_alcGetErrorNative JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative (JNIEnv *env, jobject obj, jstring deviceName) { + printf("Entering openDeviceNative()\n"); + printf("In openDeviceNative() test 1\n"); jint result; - ALubyte *str = NULL; + ALubyte *str; + ALCdevice *device; if(deviceName != NULL) { str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL); + device = alcOpenDevice(str); + printf("In openDeviceNative() test 2a -- %s - %i\n", str, (jint)device); + } else { + device = alcOpenDevice(NULL); + printf("In openDeviceNative() test 2b -- NULL - %i\n", (jint)device); + } + printf("In openDeviceNative() test 3\n"); + if(deviceName != NULL) { + (*env)->ReleaseStringUTFChars(env,deviceName,str); + printf("In openDeviceNative() test 4a\n"); + } else { + printf("In openDeviceNative() test 4b\n"); } - ALCdevice *device; - device = alcOpenDevice(str); - (*env)->ReleaseStringUTFChars(env,deviceName,str); result = (jint)device; + printf("In openDeviceNative() test 5\n"); + printf("Exiting openDeviceNative()\n"); return result; } |