e_menu: recursively delete children menus.
authorGustavo Sverzut Barbieri <barbieri@gmail.com>
Sat, 10 Jan 2009 07:02:32 +0000 (07:02 +0000)
committerGustavo Sverzut Barbieri <barbieri@gmail.com>
Sat, 10 Jan 2009 07:02:32 +0000 (07:02 +0000)
commit05402668aa64651ef65676d5ac19011cf86c5d0d
tree1c01cb1eec9733c89838c3ffc06e2e5cdeede42f
parent6ff4dd83877d80f1b0a64e14e19f7ad03c7e6a0b
e_menu: recursively delete children menus.

e_menu had this behaviour that submenus were not deleted
automatically, relying on the parent menu to hook to post_deactivate
and then delete them.

This was good because maybe you don't want to delete these children,
you might want to reuse them sometime.

But it ended that nobody was using this feature, and worse: most use
cases were failing to delete these children, causing memory leak.

This commit changes the default behaviour and thus remove all the
existing code that was replicating such work. If one want the old
behavior, just call e_menu_item_submenu_set(mi, NULL) and it will be
unbounded from the parent.

If you experience any problems with that, try adding some printf()
before _e_menu_free() and _e_menu_item_free() and print some relevant
information like m->category and m->header.title or mi->label in order
to figure out the problematic menu.

SVN revision: 38528
src/bin/e_gadcon.c
src/bin/e_int_menus.c
src/bin/e_menu.c
src/bin/e_shelf.c
src/bin/e_toolbar.c