best way to destroy a menu



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi all,

I have a GtkMenu with some items in it and some call backs associated
with those GtkMenuItems. I need to delete this menu and recreate it.

I tried

if (menu != NULL)
        gtk_widget_destroy(menu);

and

if (menu != NULL)
        gtk_widget_unref(menu);



But this just ends up throwing a lot of exceptions and eventually my app
crashes. So what is the best way to clean up a menu..

right now, I'm just doing

menu = gtk_menu_new();

whenever I need this menu recreated, but I realize this is a big memory
leak. And so I would like to avoid this.

Thanks,

Kevin
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHTx0U6w2kMH0L1dERAqR7AJ0YuKFvNv4lXRYUC4pFASRQL1QZxgCfWEsh
Mr+WjCpOMi7CKVRJgYtoJd0=
=oNw/
-----END PGP SIGNATURE-----



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