>  I have a structure that contains all my widgets:
>  
>  typedef struct {
>      GtkWidget *window;
>      GtkWidget *vbox;
>      GtkWidget *hbox;
>      GtkWidget *label;
>      GtkWidget *button;
>  } Window;

Normally you don't need pointers to all of the "auxiliary" widgets
such as boxes and labels, but that's OK.

>  now the callback main_destroy_cb:
>  
>  void main_destroy_cb(GtkWidget *widget, Window *win)
>  {
>      g_free(win);
>      gtk_main_quit();
>  }
>  
>  Is this the proper way to malloc and free memory on exit for the Window
>  structure?

Yes.

>  Also, if the Window structure is not free'd, it would end up in a memory
>  leak, correct?

Yes.

  Federico

-- 
To unsubscribe: mail -s unsubscribe [EMAIL PROTECTED] < /dev/null

Reply via email to