diff --git a/src/kits/app/Messenger.cpp b/src/kits/app/Messenger.cpp index f5e0c20c53..b36fec35a1 100644 --- a/src/kits/app/Messenger.cpp +++ b/src/kits/app/Messenger.cpp @@ -247,8 +247,10 @@ BMessenger::LockTargetWithTimeout(bigtime_t timeout) const if (error == B_OK) error = looper->LockWithTimeout(timeout); - if (error == B_OK && looper->fMsgPort != fPort) + if (error == B_OK && looper->fMsgPort != fPort) { + looper->Unlock(); return B_BAD_PORT_ID; + } return error; }