Multiple VST instances

I discovered that my plugin hangs if I try to open (not just load or use - that works fine) more than one instance (VST3) at a time in the same Reaper project. I thought this might be due to a some static variable (which, as I just learned today, are shared between VST instances), but I reworked my code to avoid static class members and am encountering the same hanging. Perhaps crucially, Reaper only hangs if more than one of my plugin’s UIs is visible at once: if I just load multiple plugins and send midi data through them, they work fine, and I can switch between them; hanging only occurs if multiple GUIs are visible.

Has anyone else encountered this issue? I’d assume the fault lies in my own code, but the vast majority of what I’ve written concerns the DSP portion of the plugin, and the issue seems to lie with the graphics. Are there any UI functions that are known to be shared between plugin instances?

addendum: I found a thread describing a similar bug in the Surge VST3. There, the issue was found to be a disagreement between the host and the plugin regarding the display size, leading to an infinite loop. The behavior described (DAW freezes but does not go into the “Not responding” state) matches what I’m experiencing.

Okay, false alarm. The culprit wasn’t a bug or any sort of graphics backend-related issue - it was a horrendously slow Draw function I had written for one of my custom controls. Some very simple optimizing solved the problem.