memory leak

i have a java program declaring class A..

now in the jni, part i have another C++ program declaring object 'a' of class A. Is 'a" considered a C++ or java object?

Also, in the C++ program i have

A *a =new A();

a=b->somemethod();

return a;

now,

somemethod also allocates memory for 'a'.

A* somemethod()

{

A * a = new A();

.....

......

return a;

}

does this double allocation for 'a' cause a memory leak?

we see that the leak is in the java object and not the C++ object..

Please suggest..

[607 byte] By [sowmyama] at [2007-11-26 18:26:36]
# 1
The code is nonsense.You can't "new" a java A from C. You have to use JNI methodfs to create a new instance of a java class.
bschauwejavaa at 2007-7-9 6:00:40 > top of Java-index,Java HotSpot Virtual Machine,Specifications...