Dellocate memory after jni methods.