< prev index next >

src/java.desktop/unix/native/common/awt/CUPSfuncs.c

Print this page

        

*** 369,389 **** { ppd_file_t *ppd; ppd_option_t *option; ppd_choice_t *choice; ppd_size_t *size; const char *name = (*env)->GetStringUTFChars(env, printer, NULL); if (name == NULL) { (*env)->ExceptionClear(env); JNU_ThrowOutOfMemoryError(env, "Could not create printer name"); return NULL; } - const char *filename; - int i; - jobjectArray sizeArray = NULL; - jfloat *dims; // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file. // unlink() must be called to remove the file after using it. filename = j2d_cupsGetPPD(name); (*env)->ReleaseStringUTFChars(env, printer, name); --- 369,389 ---- { ppd_file_t *ppd; ppd_option_t *option; ppd_choice_t *choice; ppd_size_t *size; + const char *filename = NULL; + int i; + jobjectArray sizeArray = NULL; + jfloat *dims; const char *name = (*env)->GetStringUTFChars(env, printer, NULL); if (name == NULL) { (*env)->ExceptionClear(env); JNU_ThrowOutOfMemoryError(env, "Could not create printer name"); return NULL; } // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file. // unlink() must be called to remove the file after using it. filename = j2d_cupsGetPPD(name); (*env)->ReleaseStringUTFChars(env, printer, name);
*** 468,477 **** --- 468,479 ---- int defx = 0, defy = 0; int resx = 0, resy = 0; jclass intCls, cls; jmethodID intCtr, arrListAddMID; int i; + const char *name = NULL; + const char *filename = NULL; intCls = (*env)->FindClass(env, "java/lang/Integer"); CHECK_NULL(intCls); intCtr = (*env)->GetMethodID(env, intCls, "<init>", "(I)V"); CHECK_NULL(intCtr);
*** 479,495 **** CHECK_NULL(cls); arrListAddMID = (*env)->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z"); CHECK_NULL(arrListAddMID); ! const char *name = (*env)->GetStringUTFChars(env, printer, NULL); if (name == NULL) { (*env)->ExceptionClear(env); JNU_ThrowOutOfMemoryError(env, "Could not create printer name"); return; } ! const char *filename; // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file. // unlink() must be called to remove the file after using it. filename = j2d_cupsGetPPD(name); (*env)->ReleaseStringUTFChars(env, printer, name); --- 481,497 ---- CHECK_NULL(cls); arrListAddMID = (*env)->GetMethodID(env, cls, "add", "(Ljava/lang/Object;)Z"); CHECK_NULL(arrListAddMID); ! name = (*env)->GetStringUTFChars(env, printer, NULL); if (name == NULL) { (*env)->ExceptionClear(env); JNU_ThrowOutOfMemoryError(env, "Could not create printer name"); return; } ! // NOTE: cupsGetPPD returns a pointer to a filename of a temporary file. // unlink() must be called to remove the file after using it. filename = j2d_cupsGetPPD(name); (*env)->ReleaseStringUTFChars(env, printer, name);
< prev index next >