STR #unfiled: when using Fl_Menu_::add, the 'flags' field of the last entry in a newly allocated local buffer would not be cleared. If the flag happened to be FL_SUBMENU, this would lead to crash in 'find_item'. The new code clears the entire field.

And yes, this has cost me a few hours :-P

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-10-18 09:16:55 +00:00
parent 57067a923d
commit cf296e0565

View File

@ -204,7 +204,7 @@ int Fl_Menu_::add(const char *t, int s, Fl_Callback *c,void *v,int f) {
local_array = menu_ = new Fl_Menu_Item[local_array_alloc];
memset(local_array, 0, sizeof(Fl_Menu_Item) * local_array_alloc);
}
menu_[0].text = 0;
memset(menu_, 0, sizeof(Fl_Menu_Item));
local_array_size = 1;
}
fl_menu_array_owner = this;