-
Bug
-
Resolution: Incomplete
-
P2: Important
-
None
-
5.4.0
we are using qt in a plugin to draw into the NSView * provided by a host.
sometimes we experience crashes like the following after our plugin is unloaded from the host:
(lldb) bt
* thread #1: tid = 0x4a42c, 0x00007fff912eeacf libobjc.A.dylib`objc_release + 15, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x12777cc30)
* frame #0: 0x00007fff912eeacf libobjc.A.dylib`objc_release + 15
frame #1: 0x00007fff912ed91f libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 575
frame #2: 0x00007fff8e84d272 CoreFoundation`_CFAutoreleasePoolPop + 50
frame #3: 0x00007fff8e1d414f Foundation`-[NSAutoreleasePool drain] + 153
frame #4: 0x00007fff92de4ef1 AppKit`-[NSApplication run] + 800
frame #5: 0x00007fff8e1e9fac Foundation`-[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 954
frame #6: 0x00007fff8e1e9ab0 Foundation`-[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 131
the address, which cannot be accessed (0x20(%rax)) corresponds to the following object:
[165621] 715916 ObjCClass 0x0000000002ffdc10 0x000000012777cc10 0x0000000000000028 0x001e0000 QNSView
this object is not available after unloading the plugin, therefore the application crashes.
we use getEmbeddableView (as in QMacNativeWidget) on our QWindow, add it to the host via NSView-addSubview and remove it via NSView-removeFromSuperview, before we actually delete the QWindow manually. however for some reason it seems that a QNSView * is added to an autorelease pool, which is not drained before our plugin is unloaded, causing a crash.
edit: no info are missing, i'd be more than happy to help analysing these issues