Headless Cocoa/Java app - autorelease
Headless Cocoa/Java app - autorelease
- Subject: Headless Cocoa/Java app - autorelease
- From: String Larson <email@hidden>
- Date: Mon, 2 May 2005 13:40:49 -0500
No action on java-dev... thought I'd try here.
Has anyone run JBoss on OSX AND needed to access Cocoa APIs ?
I've got this web app that needs to generate PNG and EPS image files on the fly.
When creating NSImage instances, I'm getting:
<x-tad-bigger>2005-05-01 18:01:19.750 java[4011] *** _NSAutoreleaseNoPool(): Object 0x4e29d930 of class NSImageCacheView autoreleased with no pool in place - just leaking</x-tad-bigger>
<x-tad-bigger>2005-05-01 18:01:19.751 java[4011] *** _NSAutoreleaseNoPool(): Object 0x4e29d930 of class NSImageCacheView autoreleased with no pool in place - just leaking</x-tad-bigger>
I've read up on the NSAutoreleasePool stuff, and am using the following to launch JBoss:
public class Main {
public Main() {
super();
}
public static void main(final String[] args) {
Runnable worker = new Runnable() {
public void run() {
try {
int pool = NSAutoreleasePool.push();
org.jboss.Main main = new org.jboss.Main();
main.boot(args);
NSAutoreleasePool.pop(pool);
} catch (Exception e) {
System.err.println("Failed to boot JBoss:");
e.printStackTrace();
}
}
};
int pool = NSAutoreleasePool.push();
NSApplication app = NSApplication.sharedApplication();
ThreadGroup threads = new ThreadGroup("jboss");
new Thread(threads, worker, "main").start();
NSAutoreleasePool.pop(pool);
}
}
So, both the main thread, and the jboss thread have NSAutoreleasePools in place.
Now, JBoss has worker threads that process incoming requests, AND I spawn my own threads to handle the actual image processing. Do the sub-threads need AutoreleasePools as well ?
Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden