mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
crash fix in Cocoa menus. we build this code in Camino but we don't use it. sr=pinkerton
This commit is contained in:
parent
11014437a0
commit
16ad0bb77c
@ -386,6 +386,7 @@ NS_IMETHODIMP nsMenuX::RemoveItem(const PRUint32 aPos)
|
||||
|
||||
NS_IMETHODIMP nsMenuX::RemoveAll()
|
||||
{
|
||||
//XXXJOSH why don't we set |mNumMenuItems| to 0 after removing all menu items?
|
||||
if (mMacMenu != NULL) {
|
||||
/*
|
||||
// clear command id's
|
||||
@ -399,9 +400,7 @@ NS_IMETHODIMP nsMenuX::RemoveAll()
|
||||
}
|
||||
}
|
||||
*/
|
||||
//XXXJOSH we crash here sometimes, log message shows
|
||||
// nsMenuX::RemoveAll: Total menu count is 16, attempting to access 31
|
||||
for (int i = mNumMenuItems - 1; i >= 0; i--) {
|
||||
for (int i = [mMacMenu numberOfItems] - 1; i >= 0; i--) {
|
||||
[mMacMenu removeItemAtIndex:i];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user