This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How keep state in C++ across JNI calls?  RSS feed

 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some C++ code (it's actually all global functions right now) which is called from Java like:

myObj.callNativeMethod1( someObj );
myObj.callNativeMethodThatWorksWithSomeObj( );

How can I make sure that "someObj" which was passed into the first method is still valid/usable in method 2?

EDIT: The C++ app is multithreaded. So it also needs access to that object in other threads as well as across calls.
[ October 18, 2006: Message edited by: Dan Bizman ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Didn't I just answer this for you here?
 
Dan Bizman
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
LOL, yes. My brqain was overloaded!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!