Author: post
Date: 2013-09-23 10:31:15 +0200 (Mon, 23 Sep 2013)
New Revision: 592

Modified:
   RawSpeed/RawImage.cpp
Log:
Lock mutex when using the '=' operator on RawImage.

Modified: RawSpeed/RawImage.cpp
===================================================================
--- RawSpeed/RawImage.cpp       2013-09-22 18:17:54 UTC (rev 591)
+++ RawSpeed/RawImage.cpp       2013-09-23 08:31:15 UTC (rev 592)
@@ -393,10 +393,12 @@
 RawImage& RawImage::operator=(const RawImage & p) {
   if (this == &p)      // Same object?
     return *this;      // Yes, so skip assignment, and just return *this.
+  pthread_mutex_lock(&p_->mymutex);
   RawImageData* const old = p_;
   p_ = p.p_;
   ++p_->dataRefCount;
   if (--old->dataRefCount == 0) delete old;
+  pthread_mutex_unlock(&p_->mymutex);
   return *this;
 }
 


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to