problem in jni getting object from methodst

a want to save an object gatin from java and save it into my list in c code

my probleme is when a call getobject more than one times it return null (in the first one it return the last object saved)

i dont understand why

this is my methods

to add object in my list

NIEXPORT void JNICALL Java_Matrice2_ajoutercell

(JNIEnv *env, jobject obj, jint lig, jint col,jobject objectadded){

AjouterCellule(objectadded ,lig,col,recupererAdresse(env,obj));

}

// this is a method created to save the ovject in my list

// ( in Ajoutercell a save my object like this

List->element = val;

struct list {....

jobject val

]*list;

the code work good if i use jint

and this is the method to getobject

JNIEXPORT jobject JNICALL Java_Matrice2_Getcell

(JNIEnv *env, jobject obj , jint lig, jint col){

return recuperercell(recupererAdresse(env,obj),lig,col);

}

// the method recuperercell get the object from my list

return List->valr;

i hope that some one can understand my code and help me

thanks ...

[1136 byte] By [tarekor31a] at [2007-11-27 6:58:57]
# 1
i use newglobalref and it work ; but i have to delete every ref created when i delete or modify an objectthanks to you
tarekor31a at 2007-7-12 18:49:30 > top of Java-index,Java HotSpot Virtual Machine,Specifications...