I've reproduced the SysPref freeze problem :-). I have a suggestion
about the cause (see below).
During debugging I found a bug in the .m file; there is a -release
method which looks intended to free resources. The trick with ObjC is
to free resources in the -dealloc method, like this:
-release decrements the reference-count on an object. When the ref-
count reaches zero ObjC's runtime will call dealloc for you. When I
made the change I see a rotating green line in screensaver's preview
window.
And the freeze-problem? I used NSLog to print debug messages to the
Console:
2005-07-28 12:11:25.402 System Preferences[5789]
Saver3View:initWithFrame
2005-07-28 12:11:25.455 System Preferences[5789] startVM ...
2005-07-28 12:11:25.455 System Preferences[5789] clearVMArgs ...
2005-07-28 12:11:26.061 System Preferences[5789] started VM ok
2005-07-28 12:11:26.787 System Preferences[5789] all ok so far
2005-07-28 12:11:26.838 System Preferences[5789] Apple AWT Couldn't
start headless. SetApplicationIsDaemon returned -50
Look at this message ^^^^^^^^^^^^
<animateOneframe is called many times to display your message ...>
2005-07-28 12:11:35.969 System Preferences[5789] stopVM ...
'-stopVM' attempts to destroy the Java VM you created. Note the JNI
VM unload information below
The main thread cannot detach itself from the VM. Instead, it must
call DestroyJavaVM() to unload the entire VM.
The VM waits until the main thread is the only user thread before it
actually unloads. User threads include both Java threads and attached
native threads. This restriction exists because a Java thread or
attached native thread may be holding system resources, such as
locks, windows, and so on. The VM cannot automatically free these
resources. By restricting the main thread to be the only running
thread when the VM is unloaded, the burden of releasing system
resources held by arbitrary threads is on the programmer."
Is it possible resources are being held and the VM is waiting to
unload? Because of the wait, System Preferences appears to freeze?
Rob
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden