From: Luca Padovani Date: Tue, 28 Jan 2003 14:57:55 +0000 (+0000) Subject: * added refs to the pointers passed on the signal handler!!! X-Git-Tag: V_0_0_4_1~86 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=34e75ac7ef031c8cfdd0fb184a5e8db027f1ae6a;p=helm.git * added refs to the pointers passed on the signal handler!!! --- diff --git a/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c b/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c index 2c3d80c81..7e260cd97 100644 --- a/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c +++ b/helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c @@ -148,7 +148,8 @@ value ml_gtk_math_view_gdome_element_of_boxed_option (value arg1) { CAMLparam1(arg1); - GdomeElement* nr; + GdomeException exc = 0; + GdomeElement* nr = NULL; CAMLlocal1 (res); if (arg1==Val_int(0)) { @@ -156,6 +157,12 @@ value ml_gtk_math_view_gdome_element_of_boxed_option (value arg1) } else { nr = (GdomeElement*) Field(Field(arg1,0),1); } + + if (nr != NULL) { + gdome_el_ref(nr, &exc); + assert(exc == 0); + } + res = Val_Element(nr); if (res==Val_int(0)) { assert(0); @@ -175,7 +182,12 @@ value ml_gtk_math_view_gdome_element_option_of_boxed_option (value arg1) if (arg1==Val_int(0)) { res=Val_unit; } else { - res = Val_option_ptr((GdomeElement*) Field(Field(arg1,0),1),Val_Element); + 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); } CAMLreturn(res);