From: Luca Padovani Date: Fri, 14 Feb 2003 15:10:30 +0000 (+0000) Subject: * removed memory leak (maybe) X-Git-Tag: V_0_0_4_1~42 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=6b37feb2e9d4b3cffbed4c3c7dd2977b04e9a935;p=helm.git * removed memory leak (maybe) * used Val_Element_ref instead of reffing explicitly --- diff --git a/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c b/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c index f6906b416..9a7f98fcf 100644 --- a/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c +++ b/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c @@ -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);