RE: removeFromSuperview problem
RE: removeFromSuperview problem
- Subject: RE: removeFromSuperview problem
- From: Jim Adams <email@hidden>
- Date: Thu, 26 Apr 2012 13:24:13 +0000
- Thread-topic: removeFromSuperview problem
I wonder if you should move that removeFromSuperview back onto the main thread? I know when I was doing lots of cross language stuff with java in the past that that was usually my problem.
Jim Adams
-----Original Message-----
From: cocoa-dev-bounces+jim.adams=email@hidden [mailto:cocoa-dev-bounces+jim.adams=email@hidden] On Behalf Of Leanne Attard
Sent: Thursday, April 26, 2012 2:49 AM
To: email@hidden
Subject: removeFromSuperview problem
Problem explanation:
I am doing a Java application which calls a JNI Library to draw using OpenGL on the window created by JAVA, using the JAWT NSView handle given as in example: http://developer.apple.com/library/mac/#samplecode/JAWTExample/Introduction/Intro.html, and then adding a customized NSView to the NSView given, as a subview.
When a window is resized to a smaller size the JAVA side of my code calls a native function in my library to remove the native subview added earlier. This is when the application stalls (Not Responding). Upon forcing the application to quit, a crash report pops up part of which is shown
below. As far as I can understand this, there is a deadlock. This happens upon calling removeFromSuperview method in NSView. This is called
on a different thread than the one in which the subview was added. Can this be the issue causing the problem? Any help is greatly appreciated.
Can this function be called on a different thread than the one on which 'addsubview' was called?
Thread 3f1b6
User stack:
19 thread_start + 13 (in libSystem.B.dylib) [0x7fff850a5e89]
19 _pthread_start + 331 (in libSystem.B.dylib) [0x7fff850a5fd6]
19 jio_snprintf + 35946 (in libclient64.dylib) [0x10100d244]
19 JVM_StartThread + 1362 (in libclient64.dylib) [0x1010b0cf5]
19 JVM_StartThread + 1853 (in libclient64.dylib) [0x1010b0ee0]
19 JVM_StartThread + 2203 (in libclient64.dylib) [0x1010b103e]
19 JVM_StartThread + 2299 (in libclient64.dylib) [0x1010b109e]
19 JVM_StartThread + 2565 (in libclient64.dylib) [0x1010b11a8]
19 JVM_Lseek + 193197 (in libclient64.dylib) [0x1010a511e]
19 ??? [0x104001438]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x104006a82]
19 ??? [0x10400685a]
19 ??? [0x104006e8d]
19 ??? [0x1040069b3]
19 ??? [0x104011d6e]
19 JVM_DoPrivileged + 93 (in libjvmlinkage.dylib) [0x1000961ad]
19 JVM_DoPrivileged + 560 (in libclient64.dylib) [0x1010b03b5]
19 JVM_Lseek + 192625 (in libclient64.dylib) [0x1010a4ee2]
19 JVM_Lseek + 193197 (in libclient64.dylib) [0x1010a511e]
19 ??? [0x104001438]
19 ??? [0x1040069b3]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x104006d34]
19 ??? [0x10400685a]
19 ??? [0x104006d34]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x10400685a]
19 ??? [0x104006a82]
19 ??? [0x104011d6e]
19 Java_hob_rdp_ui_sys_c_1rdpuimanager_00024c_1painter_n_1remove + 84 (rdpde.mm:370 in libmacrdpui.dylib) [0x1244b7cca]
19 hob::rdp::c_rdpwindow::unparent_window() + 339 (macrdpui.hpp:802 in libmacrdpui.dylib) [0x1244ba7cb]
19 -[NSView removeFromSuperview] + 46 (in AppKit) [0x7fff83c22143]
19 -[NSViewHierarchyLock _lockForWriting:handler:] + 528 (in AppKit) [0x7fff83be1e33]
19 __semwait_signal + 10 (in libSystem.B.dylib) [0x7fff850a7a6a]
Kernel stack:
19 semaphore_wait_continue + 0 [0x22a88f]
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden