Re: Where do menus go when they "go away"?



jseymour LinxNet com (Jim Seymour) writes:

Hi All,

It recently came to my attention that the application I'm working on
may have some memory leaks due to mis-handling menus.

We have situations where we generate pop-up menus on-the-fly for items
in a Ctree.  I've found that when these menus "go away" (either due to
selecting a menu item or clicking somewhere else to dismiss them), that
the "destroy" signal isn't emitted--only the "hide" signal.

This leads me to *suspect* that the space allocated for these isn't
free'd when they're dismissed--that the menu structures are still
sitting there, awaiting re-activation.  That to truly make them go
away, you must do a gtk_widget_destroy() on their widgets.

Have I got this right?

Yes, popup menus need to be explicitely destroyed. (A menu attached
to an option menu or menu bar will be destroyed when the option
menu or menu bar is destroyed.)

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]