From 642cc1315d43a965abb1b5d7a0738c9056ea5c87 Mon Sep 17 00:00:00 2001 From: Alexandre Deckner Date: Sun, 5 Apr 2009 18:54:15 +0000 Subject: [PATCH] * Fixes a small regression introduced in r29728, don't return B_ERROR if we couldn't lock the popup's window, in this case the window just closed, so we go on with archiving then. There's still a (rarely occuring) problem with the unlocking though, probably due to some BMenu funkyness, will investigate, left a TODO. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29947 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Dragger.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/kits/interface/Dragger.cpp b/src/kits/interface/Dragger.cpp index 5ea06c1509..6e4b476ca2 100644 --- a/src/kits/interface/Dragger.cpp +++ b/src/kits/interface/Dragger.cpp @@ -118,13 +118,17 @@ BDragger::Archive(BMessage *data, bool deep) const BMessage popupMsg; if (fPopUp) { - if (fPopUp->Window()->Lock()) { - ret = fPopUp->Archive(&popupMsg, deep); - if (ret == B_OK) - ret = data->AddMessage("_popup", &popupMsg); + bool windowLocked = fPopUp->Window()->Lock(); + + ret = fPopUp->Archive(&popupMsg, deep); + + if (windowLocked) fPopUp->Window()->Unlock(); - } else - ret = B_ERROR; + // TODO: Investigate, in some (rare) occasions the menu window + // has already been unlocked + + if (ret == B_OK) + ret = data->AddMessage("_popup", &popupMsg); } if (ret == B_OK)