fixed some pretty bad bugs that prevented menus from working (they now do): The BMessage* in AddShortcut is taken in responsibility by the BWindow, so we cannot directly use the message from BMenuItem, the be_app was locked in InitData but never unlocked, it fixes BMenus only working once, and who knows what else it fixes. A little cleanup with _BCmdKey usage, also note that it is inefficient to RemoveItem()s from a list in the destructor of any class using a BList as data container! Simply delete the items and be done with it. The BList destructor will take care of the rest and free its storage in one go.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12982 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2005-06-07 13:19:28 +00:00
parent 4ece454391
commit 442992bf26
2 changed files with 23 additions and 18 deletions
+14
View File
@@ -50,6 +50,20 @@ struct _BCmdKey{
BMessage* message;
BHandler* target;
int32 targetToken;
_BCmdKey(uint32 k, uint32 mod, BMessage* m = NULL)
: key(k),
modifiers(mod),
message(m),
target(NULL),
targetToken(B_ANY_TOKEN)
{
}
~_BCmdKey()
{
delete message;
}
};
#endif // _WINDOWAUX_H