How can we show a message box in the destructor of a VST3 processor?

Hello jucers, Please help. I just want to show a message box in the destructor of a vst3 processor:
juce::AlertWindow::showOkCancelBox(juce::AlertWindow::NoIcon, “apvts.state”, “apvts.state.toXmlString()”);

But after close the window of StandalonePlugin app, I’ve got a crash exception.
I’m trying to show or print a message in the vst3 while running in a host but don’t know how. Pls give me some guide or hints. Thanks!

I don’t think this is a good idea. Some DAWs destroy an construct your plug in several times. A destructor should give free used memory.

1 Like

At that moment there is no message manager anymore, so you can’t use it there.

Do you only want to get debugging information? There are other options for that.
I cannot believe you want to show a client the APVTS state :wink:

1 Like

It’s just used in debug code. I can run ide debug for standalone plugin but cannot for vst3 because it run in host. So I tried to log file or show message box. Can you give me some hints about other options?

I just try to show my vst3 state before exiting.

Have you tried the FileLogger class?

I just Googled “juce write debug info to file”

You are of course not the first one who is looking for how to do this:

Success

This is false, you very much can debug VST3 in a host from your IDE. Just set the host as the executable to be debugged.

Some released plugins might have “anti-debugger” code in them, and you’ll need to avoid (or even disable completely) them.

Additionally more recent versions of macOS can make attaching the debugger to a released executable impossible, in which case you need to adjust the permissions of the executable and resign it (someone shared a script for this in the forum before).

1 Like

…or use Debug/Attach to Process… after the DAW is launched.

3 Likes

I can confirm - I regularly put my VST plugins into the debugger when I load them with REAPER, which doesn’t prevent debugging. Breakpoints work, etc. You don’t need printf() style debugging once you get this set up - just use normal breaking, stepping, stack inspection, etc.