]> matita.cs.unibo.it Git - helm.git/commitdiff
* removed memory leak (maybe)
authorLuca Padovani <luca.padovani@unito.it>
Fri, 14 Feb 2003 15:10:30 +0000 (15:10 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Fri, 14 Feb 2003 15:10:30 +0000 (15:10 +0000)
* used Val_Element_ref instead of reffing explicitly

helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c

index f6906b416420e6be3539ea68d29e8d658b61deb6..9a7f98fcf4e2a14a3d97473dc6a1276792399237 100644 (file)
@@ -100,7 +100,7 @@ ML_1 (gtk_math_view_unload, GtkMathView_val, Unit)
 ML_2 (gtk_math_view_select, GtkMathView_val, Element_val, Unit)
 ML_2 (gtk_math_view_unselect, GtkMathView_val, Element_val, Unit)
 ML_2 (gtk_math_view_is_selected, GtkMathView_val, Element_val, Val_bool)
-OML_3 (gtk_math_view_get_element_at, GtkMathView_val, Int_val, Int_val, Val_Element_ref)
+OML_3 (gtk_math_view_get_element_at, GtkMathView_val, Int_val, Int_val, Val_Element)
 ML_1 (gtk_math_view_get_width, GtkMathView_val, Val_int)
 ML_1 (gtk_math_view_get_height, GtkMathView_val, Val_int)
 ML_3 (gtk_math_view_set_top, GtkMathView_val, Int_val, Int_val, Unit)
@@ -189,12 +189,7 @@ value ml_gtk_math_view_gdome_element_of_boxed_option (value arg1)
       nr = (GdomeElement*) Field(Field(arg1,0),1);
    }
 
-   if (nr != NULL) {
-     gdome_el_ref(nr, &exc);
-     assert(exc == 0);
-   }
-   
-   res = Val_Element(nr);
+   res = Val_Element_ref(nr);
    if (res==Val_int(0)) {
       assert(0);
    }
@@ -216,9 +211,7 @@ value ml_gtk_math_view_gdome_element_option_of_boxed_option (value arg1)
       GdomeException exc = 0;
       GdomeElement* elem = (GdomeElement*) Field(Field(arg1,0),1);
       assert(elem != NULL);
-      gdome_el_ref(elem, &exc);
-      assert(exc == 0);
-      res = Val_option_ptr(elem, Val_Element);
+      res = Val_option_ptr(elem, Val_Element_ref);
    }
 
    CAMLreturn(res);