diff --git a/src_main/core/piobject.h b/src_main/core/piobject.h index afa76327..2e1e9207 100755 --- a/src_main/core/piobject.h +++ b/src_main/core/piobject.h @@ -633,11 +633,12 @@ public: if (i.performer) { i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender)); } else { - if (sender->thread_safe_) i.dest_o->mutex_.lock(); + bool th = sender->thread_safe_; + if (th) i.dest_o->mutex_.lock(); i.dest_o->emitter_ = sender; ((void( *)(void * ))i.slot)(i.dest); i.dest_o->emitter_ = 0; - if (sender->thread_safe_) i.dest_o->mutex_.unlock(); + if (th) i.dest_o->mutex_.unlock(); } #ifdef PIP_CXX11_SUPPORT }