[ 1053870 ] jacob-msg 2019 - SafeArray + jni 1.4. Fixed a few problems with safe array manipulation that caused memory leaks. Also applied patch required to build against JMI newer than v1.2

This commit is contained in:
schmidlinf
2005-02-03 10:27:39 +00:00
parent e1c0b7680f
commit ebb1eddb69
4 changed files with 21 additions and 5 deletions

View File

@@ -80,7 +80,12 @@ EventProxy::~EventProxy()
pCP->Unadvise(dwEventCookie);
JNIEnv *env;
// attach to the current running thread
jvm->AttachCurrentThread((void **)&env, jvm);
#ifdef JNI_VERSION_1_2
jvm->AttachCurrentThread((void **)&env, jvm);
#else
jvm->AttachCurrentThread((void**)&env, NULL);
#endif
env->DeleteGlobalRef(javaSinkObj);
if (env->ExceptionOccurred()) { env->ExceptionDescribe(); }
@@ -140,7 +145,11 @@ STDMETHODIMP EventProxy::Invoke(DISPID dispID, REFIID riid,
if (DISPATCH_METHOD & wFlags)
{
// attach to the current running thread
jvm->AttachCurrentThread((void**)&env, jvm);
#ifdef JNI_VERSION_1_2
jvm->AttachCurrentThread((void **)&env, jvm);
#else
jvm->AttachCurrentThread((void**)&env, NULL);
#endif
// get variant class