Host crashes when instantiating multiple plugins

This most likely has been addressed many times before, but I can’t seem to properly search the forums (I strangely get just the recent posts no matter my search terms). Sorry if so…

I am getting the crash described in the “How to use this framework” file when xcode exports internal functions as symbols. My plugin (which is now just a test plugin similar to the demo plugin) loads perfectly fine if I create successive multiple instances of my plugin. The host crashes if I go back (give focus) to any earlier instances. If it matters, I am using Ableton LIVE to test.

I’m assuming it’s a symbols problem so I’ve followed the advice in the how-to file to strip the symbols, but I am at a loss as to what to do after the “nm” command. Should I just keep trying to strip the symbols? What should I do?

In case it’s helpful, the following is the relevant part of the crash log:

[code]
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000000c0000007
Crashed Thread: 0

Thread 0 Crashed:
0 com.myaddress.MyPlugin 0x23d67a37 VSTPluginMain + 1460705
1 com.myaddress.MyPlugin 0x23ce18e4 VSTPluginMain + 911502
2 com.myaddress.MyPlugin 0x23c03a3c VSTPluginMain + 2534
3 com.myaddress.MyPlugin 0x23c04998 VSTPluginMain + 6466
4 com.myaddress.MyPlugin 0x23c04f05 VSTPluginMain + 7855[/code]

What makes you think it’s the symbol bug? Doesn’t sound like that to me… When you use a debug build and catch the crash in the debugger, what’s actually happening?

I got off in the wrong debug direction (been working all day!) and didn’t consider simple reasons first.

What happened is that the jucer-created component I made for the VST plugin was deleting children after I already called “deleteAllChildren()”. Simple bug I normally don’t make… thought I was being careful with integrating the auto-gen stuff (love your Jucer to get started on new components and layout…) with the hand-coded stuff. Oops!

What I want to know now is why the destructor is getting called for a plugin when I switch focus between plugins in the host? This doesn’t make sense to me intuitively.

Thanks so much for the fast response Jules, you’re inhuman! I am a bit embarrassed actually…

I assume you mean it’s your plugin’s UI that’s being deleted, not the plugin? The UI components will come and go all the time as the host closes and opens windows.