Reaper hangs when reloading any project with my plugin, but only on startup

I received a report from a user that noticed that Reaper somethimes hangs when opening a project that uses my plugin:
t will start up, auto-load the last project and then hang. If you kill Reaper and then restart it, it will say that it could not start last time you used it and asks if it should skip loading the last project, which then works (if you skip).

What seems to trigger it, is closing Reaper while the plugin GUI window is visible.
If you first close the plugin window, and then save and quit, there is no problem.
So, the problem only shows if these 2 conditions are met:
- the project was saved when the plugin GUI was open, and
- Reaper starts up with such a project

There is also no problem if the project is loaded after Reaper started up properly, even if that project was saved while the plugin window was still open. I haven't seen this problem with other hosts, but it might still be something in my plugin as well.

Did anyone ever encounter something like this (and with Reaper in particular) and where to start looking?
Any ideas on what could be so special about the startup phase in Reaper when the last open project is loaded automatically?


I can only guess, but if you save the project with an open UI, reaper will open the project with the open UI. Maybe the timing when reaper loads the preset is a bit different at startup and leads to a deadlock in your UI and Processor code.

Can't you debug it and see where the deadlock is?

Yes, well, now that I rebuilt the plugin in order to debug it as suggested, the problem does not pop up anymore. The rebuild is done using newer JUCE code and my latest internal code however, so something must have changed somewhere in a good sense ;-)

So I should now actually go back to the state of my last official release to debug and try and find out what it was exactly, but I think I'm just going to stick to the latest code and consider it solved, unless it pops up again (I'll keep deadlock hunting in mind then!).
At least I now know I should test this case for the next release.