Component::internalMouseUp could hold a weak reference to *this initialized before the call to the mouseUp method. If the component gets deleted in it then we should skip calling its mouseDoubleClick method.
I’m curious: what’s the hierarchy like at that point? It’s possible that I don’t fully understand how that area works anymore since so much has changed – but instead of adding the weak ref, why not move the bailing out check before the call to the double-click?
// check for double-click
if (me.getNumberOfClicks() >= 2)
{
if (checker.shouldBailOut())
return;
mouseDoubleClick (checker.eventWithNearestParent());
The crash happens at the call to mouseDoubleClick (being a virtual-call of a non-existing object it may jump to invalid memory) rather than at checker.shouldBailOut.
So apparently it means that checker.shouldBailOut() returns false otherwise it wouldn’t had crashed.