SF 169946 Event Proxy leaves thread attached to VM when id of callback not recognized

This commit is contained in:
clay_shooter
2007-04-13 12:57:47 +00:00
parent 7428d6590a
commit 2f583acf41
2 changed files with 14 additions and 3 deletions

View File

@@ -30,6 +30,10 @@
<td width="13%" valign="top">1465539</td>
<td width="87%" valign="top">(pre-release 1) IEnumVariant leak fixed in patch 1674179</td>
</tr>
<tr>
<td width="13%" valign="top">1699946 </td>
<td width="87%" valign="top">(pre-release 5) Unrecognized event callback id leaves thread attached to VM when ComFailException is thrown.</td>
</tr>
<tr>
<td width="13%" valign="top">&nbsp;</td>
<td width="87%" valign="top">&nbsp;</td>

View File

@@ -139,6 +139,12 @@ STDMETHODIMP EventProxy::Invoke(DISPID dispID, REFIID riid,
eventMethodName = W2A((OLECHAR *)MethName[i]);
}
}
// added 1.12
if (!eventMethodName) {
// just bail if can't find signature. no need to attach
// printf("Invoke: didn't find method name for dispatch id %d\n",dispID);
return S_OK;
}
if (DISPATCH_METHOD & wFlags)
{
@@ -153,11 +159,12 @@ STDMETHODIMP EventProxy::Invoke(DISPID dispID, REFIID riid,
if (!eventMethodName)
{
// user did not implement this method
// printf("Invoke: didn't find method name\n");
// could not find this signature in list
// printf("Invoke: didn't find method name for dispatch id %d\n",dispID);
// this probably leaves a native thread attached to the vm when we don't want it
ThrowComFail(env, "Event method received was not defined as part of callback interface", -1);
// should we detatch before returning?? The old code didn't but I don't see why not.
// should we detatch before returning?? We probably never get here if we ThrowComFail()
// jvm->DetachCurrentThread();
return S_OK;
}