Fix a subtle bug in Fl_Menu_::menu_end()

This bug could cause memory allocation/free errors and eventually
cause a crash.
This commit is contained in:
Albrecht Schlosser 2019-07-03 17:35:03 +02:00
parent ef1c937606
commit a7c9fd88b3

View File

@ -522,8 +522,8 @@ const Fl_Menu_Item *Fl_Menu_::menu_end() {
memcpy(newMenu, local_array, n * sizeof(Fl_Menu_Item));
if (value_)
value_ = newMenu + value_offset;
fl_menu_array_owner = 0;
}
fl_menu_array_owner = 0;
return menu_;
}