Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2007-04-23 14:58:45 +0000
committerAndrew Niefer2007-04-23 14:58:45 +0000
commit17d90b94c504f35214623e1382c1a85b79d0bae9 (patch)
treeff8b6f6835d3a71f87786519cafae604bf41d056 /bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
parent89f7944a131d088a1ab5eab96a7a971505b346d0 (diff)
downloadrt.equinox.framework-17d90b94c504f35214623e1382c1a85b79d0bae9.tar.gz
rt.equinox.framework-17d90b94c504f35214623e1382c1a85b79d0bae9.tar.xz
rt.equinox.framework-17d90b94c504f35214623e1382c1a85b79d0bae9.zip
bug 181698
Diffstat (limited to 'bundles/org.eclipse.equinox.executable/library/eclipseJNI.c')
-rw-r--r--bundles/org.eclipse.equinox.executable/library/eclipseJNI.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
index d3292df62..3623107bd 100644
--- a/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
+++ b/bundles/org.eclipse.equinox.executable/library/eclipseJNI.c
@@ -271,7 +271,7 @@ static jobjectArray createRunArgs( JNIEnv *env, _TCHAR * args[] ) {
return stringArray;
}
-int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
+int startJavaJNI( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
{
int i;
int numVMArgs = -1;
@@ -358,8 +358,17 @@ int startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[] )
}
void cleanupVM(int exitCode) {
- if (jvm == 0 || env == 0)
+ JNIEnv * localEnv = env;
+ if (jvm == 0)
return;
+
+ if (secondThread)
+ (*jvm)->AttachCurrentThread(jvm, (void**)&localEnv, NULL);
+ else
+ localEnv = env;
+ if (localEnv == 0)
+ return;
+
/* we call System.exit() unless osgi.noShutdown is set */
if (shouldShutdown(env)) {
jclass systemClass = NULL;

Back to the top