When rapidly selecting and deleting clips in our timeline (DAW-like app), users sometimes get a crash and it seems like the tooltip component is possibly dereferencing the deleted GUI component.
The crash is happening in the tooltipWindow timerCallback(), where it calls displayTipInternal() and the BAD_ACCESS occurs in Component::getTransform() which I think is being called on the “lastComponentUnderMouse”.
It’s hard to understand how as you’re checking for nullptr at every opportunity and there’s only 2 possible things happening on that line - dereferencing the affineTransform or constructing a new one.
Could it be that the (mac) AutoreleasePool is drained in another thread and the tooltip’s “lastComponentUnderMouse” disappears between checking for nullptr and dereferencing it?
|0|0x0000000100eb7342 in juce::Component::getTransform() const at juce_Component.cpp:1347|
|---|---|
|1|0x0000000100eb7e78 in juce::Component::getApproximateScaleFactorForComponent(juce::Component*) |
|2|0x0000000100f95122 in juce::TooltipWindow::getDesktopScaleFactor() const|
|3|0x0000000100eb450b in juce::Point<int> juce::ScalingHelpers::unscaledScreenPosToScaled<juce::Point<int> >(juce::Component const&, juce::Point<int>)|
|4|0x0000000100f94bfe in juce::TooltipWindow::displayTipInternal(juce::Point<int>, juce::String const&, juce::TooltipWindow::ShownManually) |
|5|0x0000000100f95620 in juce::TooltipWindow::timerCallback()::$_105::operator()() const|
|6|0x0000000100f95499 in juce::TooltipWindow::timerCallback()|
|7|0x0000000100d93785 in juce::Timer::TimerThread::callTimers()|
|8|0x0000000100d93666 in juce::Timer::TimerThread::CallTimersMessage::messageCallback()|
|9|0x0000000100d9a51b in juce::MessageQueue::deliverNextMessage()|
|10|0x0000000100d9a466 in juce::MessageQueue::runLoopCallback()|
|11|0x0000000100d9a185 in juce::MessageQueue::runLoopSourceCallback(void*)|
|12|0x00007fff3250bb21 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ ()|
|13|0x00007fff3250bac0 in __CFRunLoopDoSource0 ()|
|14|0x00007fff3250b8d4 in __CFRunLoopDoSources0 ()|
|15|0x00007fff3250a740 in __CFRunLoopRun ()|
|16|0x00007fff32509bd3 in CFRunLoopRunSpecific ()|
|17|0x00007fff3105f65d in RunCurrentEventLoopInMode ()|
|18|0x00007fff3105f39d in ReceiveNextEventCommon ()|
|19|0x00007fff3105f127 in _BlockUntilNextEventMatchingListInModeWithFilter ()|
|20|0x00007fff2f6cfba4 in _DPSNextEvent ()|
|21|0x00007fff2f6ce380 in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()|
|22|0x00007fff2f6c009e in -[NSApplication run] ()|
|23|0x0000000100d83b62 in juce::MessageManager::runDispatchLoop()|
|24|0x0000000100d83a37 in juce::JUCEApplicationBase::main()|
|25|0x0000000100d8384c in juce::JUCEApplicationBase::main(int, char const**) |
|26|0x0000000100002a53 in main|