fix storing of userdata address on 64 bits version 32/16932/2
Antoine ELIAS [Wed, 29 Jul 2015 18:13:13 +0000 (20:13 +0200)]
Change-Id: I43b6db0d431818945276f41173c1a12feaa04947

scilab/modules/graphic_objects/src/cpp/createGraphicObject.cpp

index 0e30771..cf6d314 100644 (file)
@@ -98,7 +98,14 @@ int createNewFigureWithAxes()
 
         getGraphicObjectProperty(getFigureModel(), __GO_USER_DATA__, jni_int_vector, (void**)&pUserData);
 
-        increaseValRef(NULL, (int*)*pUserData);
+        if(sizeof(void*) == 4) //32 bits
+        {
+            increaseValRef(NULL, (int*)*(int*)pUserData);
+        }
+        else //64 bits
+        {
+            increaseValRef(NULL, (int*)*(long long*)pUserData);
+        }
 
         setGraphicObjectProperty(id, __GO_USER_DATA__, pUserData, jni_int_vector, iUserDataSize);
     }