My understanding is that you will be fine with what you are doing. Especially since you are using g_object_unref on the gxml object. Because people typically only use an About dialog once--if any.
So, you're only building that node of the XML file when that bit of code runs and you're unreferencing it.
And just a note to other people reading this thread... there are many means to manipulate dialogs... modal, on top of parent, etc. Furthermore, the GNOME Human Interface Guidelines cover when you should use modal dialogs and when you should not.
This dialog is modal (default). You cannot interact with parent window and cannot open another dialog until this one is closed.
Code:
GladeXML *gxml = glade_xml_new (GLADE_FILE, "aboutdialog1", NULL);
GtkWidget *dialog = glade_xml_get_widget (gxml, "aboutdialog1");
gtk_dialog_run (GTK_DIALOG (dialog));
/* clean up */
gtk_widget_destroy (dialog);
g_object_unref (gxml);
This dialog is NOT modal. You can open up multiple AND interact with parent:
Code:
GladeXML *gxml = glade_xml_new (GLADE_FILE, "aboutdialog1", NULL);
GtkWidget *dialog = glade_xml_get_widget (gxml, "aboutdialog1");
g_object_unref (gxml);
gtk_widget_show_all (dialog);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy), NULL);
This dialog is NOT modal thus you CAN interact with parent, however, you cannot open up multiple versions:
Code:
static GtkWidget *dialog = NULL;
if (GTK_IS_WIDGET(dialog)) return;
GladeXML *gxml = glade_xml_new (GLADE_FILE, "aboutdialog1", NULL);
dialog = glade_xml_get_widget (gxml, "aboutdialog1");
g_object_unref (gxml);
gtk_widget_show_all (dialog);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (gtk_widget_destroy), NULL);