Window's destructor should acquire the menu sem, not delete it. Could help fixing bug 422
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17016 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
e21b037f2b
commit
cb8bdc4eda
@ -371,12 +371,12 @@ BPopUpMenu::entry(void *arg)
|
||||
|
||||
data->selected = menu->start_track(where, autoInvoke, startOpened, rect);
|
||||
|
||||
delete_sem(data->lock);
|
||||
|
||||
// Reset the window menu semaphore
|
||||
if (data->async && data->window)
|
||||
_set_menu_sem_(data->window, B_BAD_SEM_ID);
|
||||
|
||||
delete_sem(data->lock);
|
||||
|
||||
// Commit suicide if needed
|
||||
if (menu->fAutoDestruct)
|
||||
delete menu;
|
||||
|
@ -316,6 +316,12 @@ BWindow::~BWindow()
|
||||
{
|
||||
Lock();
|
||||
|
||||
// Wait if a menu is still tracking
|
||||
if (fMenuSem > 0) {
|
||||
while (acquire_sem(fMenuSem) == B_INTERRUPTED)
|
||||
;
|
||||
}
|
||||
|
||||
fTopView->RemoveSelf();
|
||||
delete fTopView;
|
||||
|
||||
@ -328,10 +334,6 @@ BWindow::~BWindow()
|
||||
// TODO: release other dynamically-allocated objects
|
||||
free(fTitle);
|
||||
|
||||
// Deleting this semaphore will tell open menus to quit.
|
||||
if (fMenuSem > 0)
|
||||
delete_sem(fMenuSem);
|
||||
|
||||
// disable pulsing
|
||||
SetPulseRate(0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user