-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using synchronous set to false in Patch::loadPatch causes crashes #74
Comments
Here's how I'm loading the patch on a PatchManager class:
On the same PatchManager class processBlock looks like this:
|
Ok, i'll take a look. I've been fiddling with this recently and i've probably managed to break it without realising... |
Thanks for taking a look Chez! Here's how I'm initialising the plugin - initialisePlugin() is a method on my PatchManager, called once. My code for running the plugin is pretty cobbled together (any pointers appreciated!). Here it is in case that's playing any part in the crashes, though it used to work
|
When using synchronous set to false in Patch::loadPatch (https://github.com/cmajor-lang/cmajor/blob/main/include/cmajor/helpers/cmaj_Patch.h#L1975) I get these crashes about 50% of the time when I load a new patch, more if it's a bigger patch:
I think there might be something going on with multiple threads attempting to access the processLock mutex on Patch::PatchRenderer here (https://github.com/cmajor-lang/cmajor/blob/main/include/cmajor/helpers/cmaj_Patch.h#L1546). Maybe the Builder thread and the Audio thread?
Also, the renderer on the Patch is a nullptr at the point of the crash
Even when I check if plugin->patch->renderer is not a nullptr before calling processBlock I still get this error. It looks like maybe the Patch::setNewRenderer (https://github.com/cmajor-lang/cmajor/blob/main/include/cmajor/helpers/cmaj_Patch.h#L2568) is setting the render before it is initialised fully? Then maybe thread interference is happening here?
Happy to provide any more information, I've been chasing this one round for weeks (it's crashing my DAW often when I reload a patch) and can't work out how to fix it
Any help/pointers much appreciated :)
The text was updated successfully, but these errors were encountered: