sudara / melatonin_inspector

A JUCE module that gives you the ability to inspect and visually edit (non-destructively) components in your UI.
MIT License
145 stars 17 forks source link

fixed a crash (function call may happen on deleted object) #123

Closed gondre closed 1 month ago

sudara commented 1 month ago

Thanks for the contribution!

Could you provide some details about how to reproduce the crash?

gondre commented 1 month ago

I just added that include to my PluginEditor.h: #include "melatonin_inspector/melatonin_inspector.h"

and the inspector to the members: melatonin::Inspector inspector { *this };

The bug happened the first time I opened the plugin, using the vst3 in Reaper on macOS. I fixed it immediately, so I'm not sure if it's reproducible all the time or not. IIRC Reaper may create the editor twice in a row when instantiating the plugin, so I guess the callAfterDelay probably occurred right after the first created editor had been destroyed.

sudara commented 1 month ago

Ok, thanks, that's very helpful!