diff --git a/src_main/core/piobject.h b/src_main/core/piobject.h index 2e1e9207..ae8b4025 100755 --- a/src_main/core/piobject.h +++ b/src_main/core/piobject.h @@ -633,12 +633,12 @@ public: if (i.performer) { i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender)); } else { - bool th = sender->thread_safe_; - if (th) i.dest_o->mutex_.lock(); + bool ts = sender->thread_safe_; + if (ts) i.dest_o->mutex_.lock(); i.dest_o->emitter_ = sender; ((void( *)(void * ))i.slot)(i.dest); i.dest_o->emitter_ = 0; - if (th) i.dest_o->mutex_.unlock(); + if (ts) i.dest_o->mutex_.unlock(); } #ifdef PIP_CXX11_SUPPORT } @@ -661,12 +661,13 @@ public: if (i.args_count > 0) vl << PIVariant::fromValue(v0); i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl)); } else { - if (sender->thread_safe_) i.dest_o->mutex_.lock(); + bool ts = sender->thread_safe_; + if (ts) i.dest_o->mutex_.lock(); i.dest_o->emitter_ = sender; if (i.args_count == 0) ((void(*)(void *))i.slot)(i.dest); else ((void(*)(void * , T0))i.slot)(i.dest, v0); i.dest_o->emitter_ = 0; - if (sender->thread_safe_) i.dest_o->mutex_.unlock(); + if (ts) i.dest_o->mutex_.unlock(); } #ifdef PIP_CXX11_SUPPORT } @@ -689,7 +690,8 @@ public: if (i.args_count > 1) vl << PIVariant::fromValue(v1); i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl)); } else { - if (sender->thread_safe_) i.dest_o->mutex_.lock(); + bool ts = sender->thread_safe_; + if (ts) i.dest_o->mutex_.lock(); i.dest_o->emitter_ = sender; switch (i.args_count) { case 0: ((void(*)(void *))i.slot)(i.dest); break; @@ -697,7 +699,7 @@ public: default: ((void(*)(void * , T0, T1))i.slot)(i.dest, v0, v1); break; } i.dest_o->emitter_ = 0; - if (sender->thread_safe_) i.dest_o->mutex_.unlock(); + if (ts) i.dest_o->mutex_.unlock(); } #ifdef PIP_CXX11_SUPPORT } @@ -721,7 +723,8 @@ public: if (i.args_count > 2) vl << PIVariant::fromValue(v2); i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl)); } else { - if (sender->thread_safe_) i.dest_o->mutex_.lock(); + bool ts = sender->thread_safe_; + if (ts) i.dest_o->mutex_.lock(); i.dest_o->emitter_ = sender; switch (i.args_count) { case 0: ((void(*)(void *))i.slot)(i.dest); break; @@ -730,7 +733,7 @@ public: default: ((void(*)(void * , T0, T1, T2))i.slot)(i.dest, v0, v1, v2); break; } i.dest_o->emitter_ = 0; - if (sender->thread_safe_) i.dest_o->mutex_.unlock(); + if (ts) i.dest_o->mutex_.unlock(); } #ifdef PIP_CXX11_SUPPORT } @@ -755,7 +758,8 @@ public: if (i.args_count > 3) vl << PIVariant::fromValue(v3); i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl)); } else { - if (sender->thread_safe_) i.dest_o->mutex_.lock(); + bool ts = sender->thread_safe_; + if (ts) i.dest_o->mutex_.lock(); i.dest_o->emitter_ = sender; switch (i.args_count) { case 0: ((void(*)(void *))i.slot)(i.dest); break; @@ -765,7 +769,7 @@ public: default: ((void(*)(void * , T0, T1, T2, T3))i.slot)(i.dest, v0, v1, v2, v3); break; } i.dest_o->emitter_ = 0; - if (sender->thread_safe_) i.dest_o->mutex_.unlock(); + if (ts) i.dest_o->mutex_.unlock(); } #ifdef PIP_CXX11_SUPPORT }