[Ipopt] Jipopt Java interface

Edson Cordeiro do Valle edsoncv at enq.ufrgs.br
Fri Apr 18 13:06:46 EDT 2008

             Hello all
        I took a look at the Java Native Interface and I found the 
following function:

JNIEXPORT void JNICALL Java_org_coinor_Ipopt_FreeIpoptProblem
(JNIEnv *env,
jobject obj_this,
jlong pipopt){
    // cast back our class
    Jipopt *problem = (Jipopt *)pipopt;

        delete problem;

I don't think it is necessary since the smartpointers automatically 
cleans the unused references as stated in the documentation:

" As the SmartPtrs go out of scope, the reference count
 will be decremented and the objects will automatically
 be deleted."

The calling to this function from java leads the Java Virtual Machine to 
crash, so I suggest this function removal.

                                                  Edson C. do Valle
                                                edsoncv at enq.ufrgs.br
                                                   Skype: edson.cv

More information about the Ipopt mailing list