The sound disappears

Hello again.
I probably ask too many questions, but as I work on the plugin, one problem follows from another. I have created a compressor that works correctly, but there is one critical issue. Sometimes it causes the sound to disappear throughout the project. Moreover, this does not happen every time, but only from time to time. If somewhere in the project another similar plug-in appears, the sound disappears with 100% probability.
Has anyone faced such a problem?

I have a method in the plugin that calculates the compression. At the very beginning, it checks:
if(threshold < 0)
if true, then compression calculation starts. Samples are received from the buffer by the method:
buffer.getWritePointer(channel)[sample]
Do you know how to fix this bug? Or maybe you can tell me which way to dig to find the error?

what is a “similiar plugin”? did you use static variables? if you did then it could be that whatever that variable does is altered by the similiar plugin. i personally don’t know any other way how different plugins instances can communicate with each other, which is what seems to be going on here.

btw i wouldn’t do the if(threshold < 0) thing. i suppose your idea is that a properly gain-staged signal will never do anything in a compressor with threshold == 0 but think a moment about all the musicians who have no idea about gain staging and just drive the signal harder and harder the more they go into the signal chain and only turn down the end fader. for them a threshold >= 0 could still make sense in a compressor. yes, it’s an unprofessional way to work with audio, but it’s popular.

alternatively you could do checks for wether numSamples == 0 or wether the buffers are all clear to check if processing is needed

“Similar plugin” - If I set in project another instance of the plugin. I have static variables in my code, but all they are constant. I have tried not doing checks for threshold < 0, but it did not help. I noticed that the sound ALWAYS disappears when I put the plugin on a channel where there is no signal and lower the threshold below 0. With what it can be connected?

All ok, I resolved problem. In calculating method one operation returned “inf”. Excuse for troubling