]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/gtkmathview-bonobo/src/control-data.c
ocaml 3.09 transition
[helm.git] / helm / gtkmathview-bonobo / src / control-data.c
index b4885bf2afdb68343415bfbd3cea3755603f6f55..d97d0fd2f77700338a039c1f33b8e4b2f12b2952 100644 (file)
 #include "control-data.h"
 
 GtkMathViewControlData*
-gtk_math_view_control_data_new(GtkMathView *math_view)
+gtk_math_view_control_data_new(BonoboControl* control, GtkMathView *math_view)
 {
   GtkMathViewControlData *cd = g_new(GtkMathViewControlData,1);
+  cd->control = control; /* we don't ref the control this is a weak pointer */
   cd->math_view = math_view;
   gtk_widget_ref(GTK_WIDGET(math_view));
   cd->item_factory = NULL;
@@ -47,6 +48,7 @@ void
 gtk_math_view_control_data_destroy(GtkMathViewControlData* cd)
 {
   GdomeException exc = 0;
+  cd->control = NULL; /* don't unref the control, see above */
   gtk_widget_unref(GTK_WIDGET(cd->math_view));
   cd->math_view = NULL;
   if (cd->item_factory != NULL)