I have a similar question about graphical object in the Gnome
Canvas. Do I have after each creation of those objects to ref them and then on
destroy, to unref them first and destroy after?
What I'm doing now is something like :
...
gtkGfxItem =
gnome_canvas_item_new
(
gtkRoot,
gnome_canvas_line_get_type(),
"points", gtkPoints,
"fill_color_rgba",
*paOutlineColor_E, "width_pixels", TAGR_LINE_WIDTH, "cap_style", GDK_CAP_ROUND, NULL
); ...
gtk_object_destroy(GTK_OBJECT(gtkGfxItem));
But after a lot of creation and destruction, the application
get a Segmentation Fault that I cannot catch via the signal management. Also
Electric Fence doesn't say anything about any memory corruption...
Thanks for any suggestion regarding this problem,
Jean-Christophe
----- Original Message -----
Sent: Thursday, March 14, 2002 9:46
AM
Subject: Release memory for a
GtkWindow
Hello,
here again a quaestion about memory freeing for
GtkWindow objects. I create my window like
this
GtkWidget * create_window (void){
GtkWidget * window = gtk_window_new (WINDOW_TOP_LEVEL);
.......
GtkButton * button = gtk_button_new ();
.... gtk_widget_set_name (button, "button");
gtk_widget_ref (button);
gtk_widget_show (button);
gtk_object_set_data_full (GTK_OBJECT (window), "button", button,
(GtkDestroyNotify) gtk_widget_unref);
gtk_container_add (GTK_CONTAINER (window), button);
......... return window; }
int main (){
GtkWidget * toto = create_window ();
return; }
To destroy my window toto, do I only need to call
gtk_object_destroy (GTK_OBJECT (toto)); or do I need to call gtk_widget_unref
(button) and after call gtk_object_destroy on the window ??
Thanks a lot for answers !
Isabelle
|