Fix a crash bug I introduced to Deskbar last commit
Need to set fLastClickedItem to NULL so it doesn't point to a deleted item. Sorry about that.
This commit is contained in:
@@ -747,11 +747,15 @@ TExpandoMenuBar::RemoveTeam(team_id team, bool partial)
|
|||||||
BAutolock locker(sMonLocker);
|
BAutolock locker(sMonLocker);
|
||||||
// make the update thread wait
|
// make the update thread wait
|
||||||
RemoveItem(i);
|
RemoveItem(i);
|
||||||
|
if (item == fLastClickedItem)
|
||||||
|
fLastClickedItem = NULL;
|
||||||
delete item;
|
delete item;
|
||||||
while ((windowItem = dynamic_cast<TWindowMenuItem*>(
|
while ((windowItem = dynamic_cast<TWindowMenuItem*>(
|
||||||
ItemAt(i))) != NULL) {
|
ItemAt(i))) != NULL) {
|
||||||
// Also remove window items (if there are any)
|
// Also remove window items (if there are any)
|
||||||
RemoveItem(i);
|
RemoveItem(i);
|
||||||
|
if (windowItem == fLastClickedItem)
|
||||||
|
fLastClickedItem = NULL;
|
||||||
delete windowItem;
|
delete windowItem;
|
||||||
}
|
}
|
||||||
SizeWindow(-1);
|
SizeWindow(-1);
|
||||||
|
|||||||
Reference in New Issue
Block a user