Added more missing decDisplay()

This commit is contained in:
Elias Naur 2004-07-30 13:30:15 +00:00
parent b50b5ca09b
commit 2e8999c342
3 changed files with 6 additions and 1 deletions

View File

@ -60,8 +60,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor
XcursorPixel *pixels = (XcursorPixel *)env->GetDirectBufferAddress(image_buffer) + images_offset;
int stride = width*height;
XcursorImages *cursor_images = XcursorImagesCreate(num_images);
if (cursor_images == NULL)
if (cursor_images == NULL) {
decDisplay();
throwException(env, "Could not allocate cursor.");
return;
}
cursor_images->nimage = num_images;
for (int i = 0; i < num_images; i++) {
XcursorImage *cursor_image = XcursorImageCreate(width, height);

View File

@ -249,6 +249,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate
for (i = 0; i < NUM_BUTTONS; i++)
buttons[i] = 0;
if (!blankCursor()) {
decDisplay();
throwException(env, "Could not create blank cursor");
return;
}

View File

@ -216,6 +216,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass
None, None};
if (env->GetDirectBufferCapacity(handle_buffer) < sizeof(PbufferInfo)) {
decDisplay();
throwException(env, "Handle buffer not large enough");
return;
}