]> matita.cs.unibo.it Git - helm.git/commitdiff
* added refs to the pointers passed on the signal handler!!!
authorLuca Padovani <luca.padovani@unito.it>
Tue, 28 Jan 2003 14:57:55 +0000 (14:57 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Tue, 28 Jan 2003 14:57:55 +0000 (14:57 +0000)
helm/DEVEL/lablgtkmathview/ml_gtk_mathview.c

index 2c3d80c8112a86aec568d818b0c52a5048015e95..7e260cd97817734f367b89031cca9d541f115925 100644 (file)
@@ -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);