Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Little problem with JNI and arrays

 
Jarosław Piotrowski
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.

I'm trying to do some array operation with JNI. I want the native code to do produce some array content and update it to java array, but I want it to obtain copy once, and only update content later multiple times.

So I did it this way i c:
http://dev.keraj.net/jni/jni_Shit.c

and Java code looks like:

(of course library is already loaded at this point)

and I get FATAL ERROR (ACCESS VIOLATION) in Java_jni_Shit_commit
althrough if I call Java_jni_Shit_commit inside native Java_jni_Shit_init then it works.
So, I think I've missed something... why I can't just do release in another JNI call?
 
Get out of my mind! Look! A tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!