BWindow::SetDefaultButton() crashed when setting another default button.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13565 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-07-09 20:27:43 +00:00
parent 8ddc570d6f
commit 32d7b6cf21

View File

@ -1211,9 +1211,10 @@ BWindow::SetDefaultButton(BButton *button)
return;
if (fDefaultButton != NULL) {
// tell old button he's no longer the default one
fDefaultButton->MakeDefault(false);
fDefaultButton->Invalidate();
// tell old button it's no longer the default one
BButton *oldDefault = fDefaultButton;
oldDefault->MakeDefault(false);
oldDefault->Invalidate();
}
fDefaultButton = button;