Re: weird gtk_timeout_add ...



Havoc Pennington wrote about "weird gtk_timeout_add ..." :

Hmmm. What I wondered: I have an optionmenu that has some menu attached.
I need to change a lot of the menu, so I build a new one, and attach it 
with gtk_option_menu_set_menu. I'd guessed that would create a leak, so I 
looked for some way to get rid of the old menu properly. I think, calling
gtk_option_menu_remove_menu prior to attaching the new one does the job.
But I'm still not sure if something needs to be freed. Do I need to
foo_destroy the thing ?

Ah. I left out the important detail of the "floating" flag for
GtkObject. GtkObject memory management is documented in both 1.2 and
2.0 docs, differently each time, so maybe one is clearer:

  http://developer.gnome.org/doc/API/gtk/gtkobject.html 
  http://developer.gnome.org/doc/API/2.0/gtk/gtkobject.html

OK, that makes the "floating" concept clear enough. However, I still don't
know, if gtk_option_menu_set_menu is like gtk_container_add in that it
gtk_object_sink's the attached menu. Your wording seems to indicate that 
this is so, but it's not clear to me yet.


Cheers  Peter
-- 
---------------------------------------------------------------------
      Dr. Peter Rottengatter       peter rottengatter de
                                   http://www.rottengatter.de
---------------------------------------------------------------------






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