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);
|
data->selected = menu->start_track(where, autoInvoke, startOpened, rect);
|
||||||
|
|
||||||
delete_sem(data->lock);
|
|
||||||
|
|
||||||
// Reset the window menu semaphore
|
// Reset the window menu semaphore
|
||||||
if (data->async && data->window)
|
if (data->async && data->window)
|
||||||
_set_menu_sem_(data->window, B_BAD_SEM_ID);
|
_set_menu_sem_(data->window, B_BAD_SEM_ID);
|
||||||
|
|
||||||
|
delete_sem(data->lock);
|
||||||
|
|
||||||
// Commit suicide if needed
|
// Commit suicide if needed
|
||||||
if (menu->fAutoDestruct)
|
if (menu->fAutoDestruct)
|
||||||
delete menu;
|
delete menu;
|
||||||
|
@ -316,6 +316,12 @@ BWindow::~BWindow()
|
|||||||
{
|
{
|
||||||
Lock();
|
Lock();
|
||||||
|
|
||||||
|
// Wait if a menu is still tracking
|
||||||
|
if (fMenuSem > 0) {
|
||||||
|
while (acquire_sem(fMenuSem) == B_INTERRUPTED)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
fTopView->RemoveSelf();
|
fTopView->RemoveSelf();
|
||||||
delete fTopView;
|
delete fTopView;
|
||||||
|
|
||||||
@ -328,10 +334,6 @@ BWindow::~BWindow()
|
|||||||
// TODO: release other dynamically-allocated objects
|
// TODO: release other dynamically-allocated objects
|
||||||
free(fTitle);
|
free(fTitle);
|
||||||
|
|
||||||
// Deleting this semaphore will tell open menus to quit.
|
|
||||||
if (fMenuSem > 0)
|
|
||||||
delete_sem(fMenuSem);
|
|
||||||
|
|
||||||
// disable pulsing
|
// disable pulsing
|
||||||
SetPulseRate(0);
|
SetPulseRate(0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user