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

Crash in Patch Browser #5363

Closed
baconpaul opened this issue Nov 11, 2021 · 2 comments · Fixed by #5365
Closed

Crash in Patch Browser #5363

baconpaul opened this issue Nov 11, 2021 · 2 comments · Fixed by #5365
Labels
Bug Report Item submitted using the Bug Report template
Milestone

Comments

@baconpaul
Copy link
Collaborator

CtrlF / Init Sine

I think the problem here is that we are replacing the patch selector when we rebuild which the patch selector triggers

we should actually not do that!

Thread 0 Crashed:: JUCE Message Thread  Dispatch queue: com.apple.main-thread
0   org.surge-synth-team.surge-xt 	0x000000010db099fc juce::Component::isVisible() const + 12 (juce_Component.h:122)
1   org.surge-synth-team.surge-xt 	0x000000010d6f0b07 Surge::Widgets::PatchSelector::shouldTooltip() + 71 (PatchSelector.cpp:295)
2   org.surge-synth-team.surge-xt 	0x000000010d7025d8 Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0::operator()() const + 24 (PatchSelector.cpp:211)
3   org.surge-synth-team.surge-xt 	0x000000010d70259d decltype(std::__1::forward<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0&>(fp)()) std::__1::__invoke<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0&>(Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0&) + 29 (type_traits:3694)
4   org.surge-synth-team.surge-xt 	0x000000010d70254d void std::__1::__invoke_void_return_wrapper<void, true>::__call<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0&>(Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0&) + 29 (__functional_base:348)
5   org.surge-synth-team.surge-xt 	0x000000010d70251d std::__1::__function::__alloc_func<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0, std::__1::allocator<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0>, void ()>::operator()() + 29 (functional:1558)
6   org.surge-synth-team.surge-xt 	0x000000010d701249 std::__1::__function::__func<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0, std::__1::allocator<Surge::Widgets::PatchSelector::mouseEnter(juce::MouseEvent const&)::$_0>, void ()>::operator()() + 25 (functional:1732)
7   org.surge-synth-team.surge-xt 	0x000000010d931762 std::__1::__function::__value_func<void ()>::operator()() const + 50 (functional:1885)
8   org.surge-synth-team.surge-xt 	0x000000010d9316e5 std::__1::function<void ()>::operator()() const + 21 (functional:2560)
9   org.surge-synth-team.surge-xt 	0x000000010d89cf50 juce::LambdaInvoker::timerCallback() + 80 (juce_Timer.cpp:384)
10  org.surge-synth-team.surge-xt 	0x000000010d89bcbb juce::Timer::TimerThread::callTimers() + 203 (juce_Timer.cpp:114)
11  org.surge-synth-team.surge-xt 	0x000000010d89bbc6 juce::Timer::TimerThread::CallTimersMessage::messageCallback() + 38 (juce_Timer.cpp:180)
12  org.surge-synth-team.surge-xt 	0x000000010d8a2443 juce::MessageQueue::deliverNextMessage() + 99 (juce_osx_MessageQueue.h:81)
13  org.surge-synth-team.surge-xt 	0x000000010d8a2396 juce::MessageQueue::runLoopCallback() + 54 (juce_osx_MessageQueue.h:92)
14  org.surge-synth-team.surge-xt 	0x000000010d8a2095 juce::MessageQueue::runLoopSourceCallback(void*) + 21 (juce_osx_MessageQueue.h:100)
15  com.apple.CoreFoundation      	0x00007fff205382bc __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
16  com.apple.CoreFoundation      	0x00007fff20538224 __CFRunLoopDoSource0 + 180
17  com.apple.CoreFoundation      	0x00007fff20537fa4 __CFRunLoopDoSources0 + 242
18  com.apple.CoreFoundation      	0x00007fff205369cc __CFRunLoopRun + 893
19  com.apple.CoreFoundation      	0x00007fff20535f8c CFRunLoopRunSpecific + 563
20  com.apple.HIToolbox           	0x00007fff2877e1f3 RunCurrentEventLoopInMode + 292
21  com.apple.HIToolbox           	0x00007fff2877df55 ReceiveNextEventCommon + 587
22  com.apple.HIToolbox           	0x00007fff2877dcf3 _BlockUntilNextEventMatchingListInModeWithFilter + 70
23  com.apple.AppKit              	0x00007fff22d3f172 _DPSNextEvent + 864
24  com.apple.AppKit              	0x00007fff22d3d945 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
25  com.apple.AppKit              	0x00007fff22d2fc69 -[NSApplication run] + 586
26  org.surge-synth-team.surge-xt 	0x000000010d88ca49 juce::MessageManager::runDispatchLoop() + 153 (juce_mac_MessageManager.mm:359)
27  org.surge-synth-team.surge-xt 	0x000000010d88c92f juce::JUCEApplicationBase::main() + 399 (juce_ApplicationBase.cpp:262)
28  org.surge-synth-team.surge-xt 	0x000000010d88c73c juce::JUCEApplicationBase::main(int, char const**) + 60 (juce_ApplicationBase.cpp:240)
29  org.surge-synth-team.surge-xt 	0x000000010d1d7883 main + 51 (juce_audio_plugin_client_Standalone.cpp:47)
30  libdyld.dylib                 	0x00007fff2045bf3d start + 1
@baconpaul baconpaul added the Bug Report Item submitted using the Bug Report template label Nov 11, 2021
@baconpaul baconpaul added this to the Surge XT 1.0 milestone Nov 11, 2021
@baconpaul
Copy link
Collaborator Author

yeah clearly the create/delete cycle in SGE is wonky.
if i put a print in the ctor/dtor i see 2 created and 1 flipping around and stuff.

@baconpaul
Copy link
Collaborator Author

OK I can fix it with this (relatively obvious) diff. the componentForSkin doesn't read the cache because, well, why would it for something which is managed outside the juce skin components set. but I don't want to merge that - I want to think about a better pattern for it.

diff --git a/src/surge-xt/gui/SurgeGUIEditor.cpp b/src/surge-xt/gui/SurgeGUIEditor.cpp
index ff76fa0d..f82dde0f 100644
--- a/src/surge-xt/gui/SurgeGUIEditor.cpp
+++ b/src/surge-xt/gui/SurgeGUIEditor.cpp
@@ -1517,8 +1517,11 @@ void SurgeGUIEditor::openOrRecreateEditor()
         }
         case Surge::Skin::Connector::NonParameterConnection::PATCH_BROWSER:
         {
-            patchSelector =
-                componentForSkinSession<Surge::Widgets::PatchSelector>(skinCtrl->sessionid);
+            if (!patchSelector)
+            {
+                patchSelector =
+                    componentForSkinSession<Surge::Widgets::PatchSelector>(skinCtrl->sessionid);
+            }
             patchSelector->addListener(this);
             patchSelector->setStorage(&(this->synth->storage));
             patchSelector->setTag(tag_patchname);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant