Skip to content

Commit 3ec54d2

Browse files
authored
463: Unanonymised QMutexLocker usage in OCIOIPNode.cpp (#476)
### Linked issues Should fix [#463](#463) ### Summarize your change. Added "lock" variable name to all anonymous QMutexLocker instances to extend their lifespan to the end of their scope. This matches the QMutexLocker usage in other parts of the app (RVConsoleWindow.cpp and QTAudioRenderer.cpp). ### Describe the reason for the change Enabling OCIO was causing frequent crashing when reader threads were set greater than 1, in particular under MacOS Sonoma. Signed-off-by: kenmcgaugh <[email protected]>
1 parent ca3a467 commit 3ec54d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/ip/OCIONodes/OCIOIPNode.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ OCIO::MatrixTransformRcPtr OCIOIPNode::getMatrixTransformXYZToRec709()
294294
{
295295
if (!m_matrix_xyz_to_rec709)
296296
{
297-
QMutexLocker(&this->m_lock);
297+
QMutexLocker lock(&this->m_lock);
298298
if (!m_matrix_xyz_to_rec709)
299299
{
300300
m_matrix_xyz_to_rec709 = createMatrixTransformXYZToRec709();
@@ -308,7 +308,7 @@ OCIO::MatrixTransformRcPtr OCIOIPNode::getMatrixTransformRec709ToXYZ()
308308
{
309309
if (!m_matrix_rec709_to_xyz)
310310
{
311-
QMutexLocker(&this->m_lock);
311+
QMutexLocker lock(&this->m_lock);
312312
if (!m_matrix_rec709_to_xyz)
313313
{
314314
m_matrix_rec709_to_xyz = createMatrixTransformXYZToRec709();
@@ -477,7 +477,7 @@ OCIOIPNode::evaluate(const Context& context)
477477

478478
if (!m_transform)
479479
{
480-
QMutexLocker(&this->m_lock);
480+
QMutexLocker lock(&this->m_lock);
481481
if (!m_transform)
482482
{
483483
m_transform = OCIO::GroupTransform::Create();
@@ -522,7 +522,7 @@ OCIOIPNode::evaluate(const Context& context)
522522

523523
if (!m_transform)
524524
{
525-
QMutexLocker(&this->m_lock);
525+
QMutexLocker lock(&this->m_lock);
526526
if (!m_transform)
527527
{
528528
m_transform = OCIO::GroupTransform::Create();
@@ -546,7 +546,7 @@ OCIOIPNode::evaluate(const Context& context)
546546
shaderName << "OCIO_sd_" << name() << "_" << hex << hashValue;
547547
}
548548

549-
QMutexLocker( &this->m_lock );
549+
QMutexLocker lock(&this->m_lock);
550550
OCIO::GpuShaderDescRcPtr shaderDesc =
551551
OCIO::GpuShaderDesc::CreateShaderDesc();
552552
shaderDesc->setFunctionName( shaderName.str().c_str() );

0 commit comments

Comments
 (0)