-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix producing of NaN from Env/LFO parameter change while playing. #3761
Conversation
Guarantee thread safety to ensure fillLevel() not to read value from wrong buffer address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use QMutexLockers to ensure safe unlocking in cases of exceptions, etc.
@@ -291,6 +291,8 @@ void EnvelopeAndLfoParameters::fillLevel( float * _buf, f_cnt_t _frame, | |||
const f_cnt_t _release_begin, | |||
const fpp_t _frames ) | |||
{ | |||
m_paramMutex.lock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a QMutexLocker here to ensure safe unlocking in cases of exceptions, etc.
@@ -402,6 +406,8 @@ void EnvelopeAndLfoParameters::loadSettings( const QDomElement & _this ) | |||
|
|||
void EnvelopeAndLfoParameters::updateSampleVars() | |||
{ | |||
m_paramMutex.lock(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a QMutexLocker here to ensure safe unlocking in cases of exceptions, etc.
@michaelgregorius Done via 667ee11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Issue fixed.
I'll merge it after 12~24 hours if there's no objection. |
…S#3761) Guarantee thread safety to ensure fillLevel() not to read value from wrong buffer address.
…S#3761) Guarantee thread safety to ensure fillLevel() not to read value from wrong buffer address.
…S#3761) Guarantee thread safety to ensure fillLevel() not to read value from wrong buffer address.
Fixes #3408.
Guarantee thread safety to ensure
fillLevel()
not to read value from wrong buffer address, because of buffer reallocation inupdateSampleVars()
.