aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/newt
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-01-06 01:40:39 +0000
committerKenneth Russel <[email protected]>2009-01-06 01:40:39 +0000
commit0beea6ff8b6f208b25801666c92031eb2cf9ccc1 (patch)
tree343cdcaa72c55e7e93f1ffd9a6c6293f366a051f /src/native/newt
parent8d38222fc13c1e3f42ee0c0afb193e517749e94e (diff)
Fixed problems exposed by SoyLatte JRE where there was no
NSAutoreleasePool present. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1839 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/native/newt')
-rw-r--r--src/native/newt/MacWindow.m17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/native/newt/MacWindow.m b/src/native/newt/MacWindow.m
index f6b2bf5b2..5b479e05d 100644
--- a/src/native/newt/MacWindow.m
+++ b/src/native/newt/MacWindow.m
@@ -162,8 +162,10 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow
JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKeyAndOrderFront
(JNIEnv *env, jobject unused, jlong window)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) window);
[win makeKeyAndOrderFront: win];
+ [pool release];
}
/*
@@ -174,8 +176,10 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_makeKeyAndOrder
JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_orderOut
(JNIEnv *env, jobject unused, jlong window)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) window);
[win orderOut: win];
+ [pool release];
}
/*
@@ -186,8 +190,10 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_orderOut
JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_close0
(JNIEnv *env, jobject unused, jlong window)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) window);
[win close];
+ [pool release];
}
/*
@@ -215,6 +221,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_dispatchMessage
(JNIEnv *env, jobject unused, jint eventMask)
{
NSEvent* event = NULL;
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[NewtMacWindow setJNIEnv: env];
do {
@@ -228,6 +235,7 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_dispatchMessage
}
} while (event != NULL);
[NewtMacWindow setJNIEnv: NULL];
+ [pool release];
}
/*
@@ -238,8 +246,11 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_dispatchMessage
JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_contentView
(JNIEnv *env, jobject unused, jlong window)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) window);
- return (jlong) ((intptr_t) [win contentView]);
+ jlong res = (jlong) ((intptr_t) [win contentView]);
+ [pool release];
+ return res;
}
/*
@@ -250,9 +261,11 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_contentView
JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setContentSize
(JNIEnv *env, jobject unused, jlong window, jint w, jint h)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) window);
NSSize sz = NSMakeSize(w, h);
[win setContentSize: sz];
+ [pool release];
}
/*
@@ -263,6 +276,8 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setContentSize
JNIEXPORT void JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_setFrameTopLeftPoint
(JNIEnv *env, jobject unused, jlong window, jint x, jint y)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
NSWindow* win = (NSWindow*) ((intptr_t) window);
setFrameTopLeftPoint(win, x, y);
+ [pool release];
}