Description
My application uses QSystemTrayIcon. On process exit, a crash occurs at qtbase/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm:431 (in QNSImageView::drawRect()).
It feels like there is a double-delete problem; accessing [parent item] is the issue. But it parent was null, then this would not crash.
When I remove code that deletes some objects in the object hierarchy, the problem goes away. Everything's allocated on the heap, so it appears that something about object ownership is being violated.
It is not easy to reproduce; I can only get it to consistently happen with a Macbook Pro hooked up to an external display (actually a projector) via HDMI, and only when I boot up the system with the external display attached. If I remove/attach the display cable after startup, the incidence of the crash goes down dramatically.
I cannot reproduce reliably on a Mac mini attached to 2 LCD displays (via HDMI->DVI and DisplayPort->VGA).
Crash report attached.
I'm willing to believe that I'm doing something wrong rather than Qt, but I'm having trouble finding anything! As far as I can tell, I'm following object ownership rules.