Chaos on plugin start-up in reaper

I’m working on an IPlug2 version of FreeVerb with an added pre-delay. I started with a duplicate of IPlugEffect. The main change from the original FreeVerb code is that I’m dynamically allocating all of the allpass and comb buffers.
The plugin is working but here’s the problem:

I have it inserted in Reaper but disabled. Then I start Reaper, fine bypassed, and If I enable all is good.
But, if I save the session with the plugin enabled and then re-open the session, all hell breaks loose with full scale noise on both plugin output channels. disabling and re-enabling does not help. It goes on forever, not just a short burst.

Oh, and I do not see this happening with savihost.

Any ideas on what might be causing this?

My guess would be uninitialised memory for the delay lines

Well, as soon as i allocate the buffers with new, i set them to 0. Also, strange that savihost does not show a similar problem. Not sure what savihost feeds as input signal but i can see output levels look normal in the status bar. After i open Reaper, i assume it’s just sending me buffers of 0s. Until i hit play. But i get this blowup immediately on open. I’ll do some more digging.

I’ve been debugging with savihost but since my problem seems to occur only in Reaper, I’d like to debug there.
The default settings didn’t work so I tried these which seem to be right but also don’t work.

Command is the correct path to Reaper x64
Command Arguments is the rpp project in the solution folder
working directory is the solution folder

Help!

There is a python script you can use to set up the visual studio debug options for a particular windows host. It modifies common-win.props.

make sure to run it when Visual Studio is closed.

Thanks Oli. This will simplify life.