SF 1674179 enum variant leak. also affects 1112667 1465539 1569864

This commit is contained in:
clay_shooter
2007-03-10 16:04:39 +00:00
parent 3a2e9429f3
commit 165b6b7646
4 changed files with 26 additions and 4 deletions

View File

@@ -19,7 +19,7 @@
The file for MS Visual C++ 6.0 building only the 32 bit version The file for MS Visual C++ 6.0 building only the 32 bit version
(the only version available through 1.11) looks something like: (the only version available through 1.11) looks something like:
JDK=d:/j2sdk1.4.2_09 JDK=d:/j2sdk1.4.2_13
MSDEVDIR=d:\\apps\\Microsoft Visual Studio\\VC98 MSDEVDIR=d:\\apps\\Microsoft Visual Studio\\VC98
version=1.11-pre2 version=1.11-pre2
@@ -27,7 +27,7 @@
compilation_tools.properties in this situation should look compilation_tools.properties in this situation should look
something like: something like:
JDK=d:/j2sdk1.4.2_09 JDK=d:/j2sdk1.4.2_13
MSDEVDIR=d:\\apps\\Microsoft Visual Studio\\VC98 MSDEVDIR=d:\\apps\\Microsoft Visual Studio\\VC98
MSSDKDIR=D:\\Apps\\Microsoft Platform SDK for Windows Server 2003 R2 MSSDKDIR=D:\\Apps\\Microsoft Platform SDK for Windows Server 2003 R2
version=1.11-pre2 version=1.11-pre2

View File

@@ -21,11 +21,23 @@
<td width="13%" valign="top">1651926 </td> <td width="13%" valign="top">1651926 </td>
<td width="87%" valign="top">ActiveXComponent: getPropertyAsString should call getString() instead of toString()</td> <td width="87%" valign="top">ActiveXComponent: getPropertyAsString should call getString() instead of toString()</td>
</tr> </tr>
<tr>
<td width="13%" valign="top">1569864 </td>
<td width="87%" valign="top">IEnumVariant leak fixed in patch 1674179</td>
</tr>
<tr>
<td width="13%" valign="top">1112667</td>
<td width="87%" valign="top">IEnumVariant leak fixed in patch 1674179</td>
</tr>
<tr>
<td width="13%" valign="top">1465539</td>
<td width="87%" valign="top">IEnumVariant leak fixed in patch 1674179</td>
</tr>
<tr> <tr>
<td width="13%" valign="top">1504120 </td> <td width="13%" valign="top">1504120 </td>
<td width="87%" valign="top">Microsoft 2003 Server crashes. Server crashes on MS 2003 Server have been reported over time. <td width="87%" valign="top">Microsoft 2003 Server crashes. Server crashes on MS 2003 Server have been reported over time.
Some users have had say that Jacob must be built on MS2003 Server to run reliably. Some users have had say that Jacob must be built on MS2003 Server to run reliably.
The Jacob distribution on Sourceforge is built on Windows XP SP2 (this item is soley informationional)</td> The Jacob distribution on Sourceforge is built on Windows XP SP2 (No code change. Just a documentation updat)</td>
</tr> </tr>
<tr> <tr>
<td width="13%" valign="top">&nbsp;</td> <td width="13%" valign="top">&nbsp;</td>
@@ -40,6 +52,10 @@
in hashmap. This causes objects to be garbage finalized when they shouldn't be resulting in vm failures in hashmap. This causes objects to be garbage finalized when they shouldn't be resulting in vm failures
with large (large) numbers of objects. </td> with large (large) numbers of objects. </td>
</tr> </tr>
<tr>
<td width="13%" valign="top">1674179</td>
<td width="87%" valign="top">Fixed Enum leaks with EnumVariants in Variant.cpp and EnumVariant.cpp</td>
</tr>
<tr> <tr>
<td width="13%" valign="top">&nbsp;</td> <td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">&nbsp;</td> <td width="87%" valign="top">&nbsp;</td>

View File

@@ -81,6 +81,10 @@ Java_com_jacob_com_EnumVariant_Next(JNIEnv* env, jobject _this, jobjectArray var
VariantCopy(v, sink + idx); VariantCopy(v, sink + idx);
env->SetObjectArrayElement(vars, idx, newVariant); env->SetObjectArrayElement(vars, idx, newVariant);
env->DeleteLocalRef(newVariant); env->DeleteLocalRef(newVariant);
//Sourceforge-1674179 fix memory leak
// Variants received while iterating IEnumVARIANT must be cleared when no longer needed
// The variant has been copied so no longer needed
VariantClear(sink);
} }
CoTaskMemFree(sink); CoTaskMemFree(sink);
return (jint)fetchCount; return (jint)fetchCount;

View File

@@ -181,7 +181,9 @@ JNIEXPORT jobject JNICALL Java_com_jacob_com_Variant_toEnumVariant
return NULL; return NULL;
} }
// I am copying the pointer to java // I am copying the pointer to java
if (ie) ie->AddRef(); // SF-1674179 fix EnumVariants memory leak
// AJ: yes, but the QueryInterface call above already incremented the reference
//if (ie) ie->AddRef();
jobject newAuto = env->NewObject(autoClass, autoCons, ie); jobject newAuto = env->NewObject(autoClass, autoCons, ie);
return newAuto; return newAuto;
} }