Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: LassoComponent deletion crash when used with touch. With mouse it's fine [develop, 8.0.1] #1416

Open
1 task done
onar3d opened this issue Aug 2, 2024 · 0 comments

Comments

@onar3d
Copy link

onar3d commented Aug 2, 2024

Detailed steps on how to reproduce the bug

in .h file:
std::unique_ptr<LassoComponent<TimelinesDraggable*>> m_LassoComponent;

in .cpp file:
::mouseDown(const MouseEvent& e) {
m_LassoComponent = std::make_unique<LassoComponent<TimelinesDraggable*>>();
addChildComponent(m_LassoComponent.get());
m_LassoComponent->beginLasso(e, this);
}

::mouseDrag(const MouseEvent& e) {
m_LassoComponent->dragLasso(e);
}

::mouseUp(const MouseEvent& e) {
m_LassoComponent->endLasso();
removeChildComponent(m_LassoComponent.get());
m_LassoComponent.release();
}

The above works fine when interacting with the mouse.

But when selecting with a finger on a (multi) touch screen (iPad Pro over Duet), and then closing the view that contained the hosting component, there's a crash with the stacktrace shared.

This happens with develop, Juce 8.0.1, and the latest version 7 too i think (I tested with an older release build that used Juce 7).

I haven't spent the time to make a minimal demonstration of this, and there's no lasso in the Juce demo that I know of. If I'm missing something do point me to the demo with a lasso and I will try to reproduce the behavior there too.

What is the expected behavior?

That it won't crash.

Operating systems

Windows

What versions of the operating systems?

11

Architectures

64-bit

Stacktrace

>	TWO.exe!std::default_delete<juce::LassoComponent<TimelinesDraggable *>>::operator()(juce::LassoComponent<TimelinesDraggable *> * _Ptr) Line 3300	C++
 	TWO.exe!std::unique_ptr<juce::LassoComponent<TimelinesDraggable *>,std::default_delete<juce::LassoComponent<TimelinesDraggable *>>>::~unique_ptr<juce::LassoComponent<TimelinesDraggable *>,std::default_delete<juce::LassoComponent<TimelinesDraggable *>>>() Line 3410	C++
 	TWO.exe!KeyframeLaneComponent<__int64>::~KeyframeLaneComponent<__int64>() Line 61	C++
 	TWO.exe!TimeValue_LaneComponent::~TimeValue_LaneComponent() Line 60	C++
 	[External Code]	
 	TWO.exe!juce::Component::deleteAllChildren() Line 1238	C++
 	TWO.exe!KeyframeLaneComponent<__int64>::~KeyframeLaneComponent<__int64>() Line 57	C++
 	[External Code]	
 	TWO.exe!ClipBGComponent::~ClipBGComponent() Line 37	C++
 	[External Code]	
 	TWO.exe!juce::Viewport::deleteOrRemoveContentComp() Line 192	C++
 	TWO.exe!juce::Viewport::~Viewport() Line 172	C++
 	[External Code]	
 	TWO.exe!TimelineBase<__int64>::~TimelineBase<__int64>() Line 552	C++
 	[External Code]	
 	TWO.exe!TimelineLaneTVItemLaneComponent::~TimelineLaneTVItemLaneComponent() Line 201	C++
 	[External Code]	
 	TWO.exe!juce::TreeView::ContentComponent::Deleter::operator()(juce::TreeView::ItemComponent * ptr) Line 709	C++
 	[External Code]	
 	TWO.exe!juce::TreeView::ContentComponent::itemBeingDeleted(const juce::TreeViewItem * item) Line 352	C++
 	TWO.exe!juce::TreeViewItem::~TreeViewItem() Line 1578	C++
 	TWO.exe!TwoTreeViewItemBase::~TwoTreeViewItemBase() Line 10	C++
 	TWO.exe!EditTreeBase::~EditTreeBase() Line 35	C++
 	[External Code]	
 	TWO.exe!TimelineLaneTVItemLaneBase::~TimelineLaneTVItemLaneBase() Line 39	C++
 	[External Code]	
 	TWO.exe!juce::OwnedArray<juce::TreeViewItem,juce::DummyCriticalSection>::remove(int indexToRemove, bool deleteObject) Line 593	C++
 	TWO.exe!juce::TreeViewItem::removeSubItemFromList(int index, bool deleteItem) Line 1671	C++
 	TWO.exe!juce::TreeViewItem::removeAllSubItemsFromList() Line 1619	C++
 	TWO.exe!juce::TreeViewItem::clearSubItems() Line 1606	C++
 	TWO.exe!ClipLaneTV::itemOpennessChanged(bool isNowOpen) Line 43	C++
 	TWO.exe!juce::TreeViewItem::setOpenness(juce::TreeViewItem::Openness newOpenness) Line 1693	C++
 	TWO.exe!juce::TreeViewItem::setOpen(bool shouldBeOpen) Line 1708	C++
 	TWO.exe!EditTreeBase::openChanged(bool open) Line 184	C++
 	TWO.exe!juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::callCheckedExcluding::__l2::<lambda_1>::operator()(EditTreeVCO::Listener & l) Line 336	C++
 	TWO.exe!juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::callCheckedExcluding<`juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::callCheckedExcluding<juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::DummyBailOutChecker,bool,bool &>'::`2'::<lambda_1>,juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::DummyBailOutChecker>(EditTreeVCO::Listener * listenerToExclude, const juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::DummyBailOutChecker & bailOutChecker, juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::callCheckedExcluding::__l2::<lambda_1> && callback) Line 277	C++
 	TWO.exe!juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::callCheckedExcluding<juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::DummyBailOutChecker,bool,bool &>(EditTreeVCO::Listener * listenerToExclude, const juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::DummyBailOutChecker & bailOutChecker, void(EditTreeVCO::Listener::*)(bool) callbackFunction, bool & <args_0>) Line 334	C++
 	TWO.exe!juce::ListenerList<EditTreeVCO::Listener,juce::Array<EditTreeVCO::Listener *,juce::DummyCriticalSection,0>>::call<bool,bool &>(void(EditTreeVCO::Listener::*)(bool) callbackFunction, bool & <args_0>) Line 286	C++
 	TWO.exe!EditTreeVCO::setOpen(bool open) Line 494	C++
 	TWO.exe!ClipLaneTV_LabelItemComponent::buttonClicked(juce::Button * buttonThatWasClicked) Line 344	C++
 	TWO.exe!juce::Button::sendClickMessage::__l2::<lambda_1>::operator()(juce::Button::Listener & l) Line 428	C++
 	TWO.exe!juce::ListenerList<juce::Button::Listener,juce::Array<juce::Button::Listener *,juce::DummyCriticalSection,0>>::callCheckedExcluding<`juce::Button::sendClickMessage'::`2'::<lambda_1>,juce::Component::BailOutChecker>(juce::Button::Listener * listenerToExclude, const juce::Component::BailOutChecker & bailOutChecker, juce::Button::sendClickMessage::__l2::<lambda_1> && callback) Line 277	C++
 	TWO.exe!juce::ListenerList<juce::Button::Listener,juce::Array<juce::Button::Listener *,juce::DummyCriticalSection,0>>::callChecked<`juce::Button::sendClickMessage'::`2'::<lambda_1>,juce::Component::BailOutChecker>(const juce::Component::BailOutChecker & bailOutChecker, juce::Button::sendClickMessage::__l2::<lambda_1> && callback) Line 235	C++
 	TWO.exe!juce::Button::sendClickMessage(const juce::ModifierKeys & modifiers) Line 428	C++
 	TWO.exe!juce::Button::setToggleState(bool shouldBeOn, juce::NotificationType clickNotification, juce::NotificationType stateNotification) Line 204	C++
 	TWO.exe!juce::Button::setToggleState(bool shouldBeOn, juce::NotificationType notification) Line 169	C++
 	TWO.exe!juce::Button::internalClickCallback(const juce::ModifierKeys & modifiers) Line 372	C++
 	TWO.exe!juce::Button::mouseUp(const juce::MouseEvent & e) Line 497	C++
 	TWO.exe!juce::Component::internalMouseUp(juce::MouseInputSource source, const juce::detail::PointerState & relativePointerState, juce::Time time, juce::ModifierKeys oldModifiers) Line 2248	C++
 	TWO.exe!juce::detail::MouseInputSourceImpl::sendMouseUp(juce::Component & comp, const juce::detail::PointerState & pointerState, juce::Time time, juce::ModifierKeys oldMods) Line 160	C++
 	TWO.exe!juce::detail::MouseInputSourceImpl::setButtons(const juce::detail::PointerState & pointerState, juce::Time time, juce::ModifierKeys newButtonState) Line 213	C++
 	TWO.exe!juce::detail::MouseInputSourceImpl::handleEvent(juce::ComponentPeer & newPeer, juce::Point<float> positionWithinPeer, juce::Time time, const juce::ModifierKeys newMods, float newPressure, float newOrientation, juce::PenDetails pen) Line 340	C++
 	TWO.exe!juce::MouseInputSource::handleEvent(juce::ComponentPeer & peer, juce::Point<float> pos, __int64 time, juce::ModifierKeys mods, float pressure, float orientation, const juce::PenDetails & penDetails) Line 89	C++
 	TWO.exe!juce::ComponentPeer::handleMouseEvent(juce::MouseInputSource::InputSourceType type, juce::Point<float> pos, juce::ModifierKeys newMods, float newPressure, float newOrientation, __int64 time, juce::PenDetails pen, int touchIndex) Line 99	C++
 	TWO.exe!juce::HWNDComponentPeer::handleTouchInput(const tagTOUCHINPUT & touch, const bool isDown, const bool isUp, const float touchPressure, const float orientation) Line 2921	C++
 	TWO.exe!juce::HWNDComponentPeer::handlePointerInput(unsigned __int64 wParam, __int64 lParam, const bool isDown, const bool isUp) Line 2964	C++
 	TWO.exe!juce::HWNDComponentPeer::peerWindowProc(HWND__ * h, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 3644	C++
 	TWO.exe!juce::HWNDComponentPeer::windowProc(HWND__ * h, unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 3550	C++
 	[External Code]	
 	TWO.exe!juce::InternalMessageQueue::dispatchNextMessage(bool returnIfNoPendingMessages) Line 151	C++
 	TWO.exe!juce::detail::dispatchNextMessageOnSystemQueue(bool returnIfNoPendingMessages) Line 274	C++
 	TWO.exe!juce::MessageManager::runDispatchLoop() Line 124	C++
 	TWO.exe!juce::JUCEApplicationBase::main() Line 277	C++
 	TWO.exe!WinMain(HINSTANCE__ * __formal, HINSTANCE__ * __formal, char * __formal, int __formal) Line 560	C++
 	[External Code]

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

I HAVE tested against the develop branch

Code of Conduct

  • I agree to follow the Code of Conduct
@onar3d onar3d changed the title [Bug]: LassoComponent detructor crash when used with touch. With mouse it's fine [8.0.1] [Bug]: LassoComponent deletion crash when used with touch. With mouse it's fine [8.0.1] Aug 2, 2024
@onar3d onar3d changed the title [Bug]: LassoComponent deletion crash when used with touch. With mouse it's fine [8.0.1] [Bug]: LassoComponent deletion crash when used with touch. With mouse it's fine [develop, 8.0.1] Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant