From e8d650a5cb1e3d80c266271d87788670718b895f Mon Sep 17 00:00:00 2001 From: athomas Date: Wed, 19 Nov 2003 00:30:26 +0000 Subject: 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 --- src/native/alcbind.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'src/native/alcbind.c') 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; } -- cgit v1.2.3