Robert Shearman : oleaut32: Don' t try to release NULL COM objects in the typelib

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 14 07:27:51 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 9030ff2c13a76b8750a7f97291141b10998467cb
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=9030ff2c13a76b8750a7f97291141b10998467cb

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Feb 14 11:33:03 2006 +0100

oleaut32: Don't try to release NULL COM objects in the typelib
marshaler.

---

 dlls/oleaut32/tmarshal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c
index 9e4b612..249524a 100644
--- a/dlls/oleaut32/tmarshal.c
+++ b/dlls/oleaut32/tmarshal.c
@@ -676,14 +676,14 @@ serialize_param(
 	if (debugout) TRACE_(olerelay)("unk(0x%lx)",*arg);
 	if (writeit)
 	    hres = _marshal_interface(buf,&IID_IUnknown,(LPUNKNOWN)*arg);
-	if (dealloc)
+	if (dealloc && *(IUnknown **)arg)
 	    IUnknown_Release((LPUNKNOWN)*arg);
 	return hres;
     case VT_DISPATCH:
 	if (debugout) TRACE_(olerelay)("idisp(0x%lx)",*arg);
 	if (writeit)
 	    hres = _marshal_interface(buf,&IID_IDispatch,(LPUNKNOWN)*arg);
-	if (dealloc)
+	if (dealloc && *(IUnknown **)arg)
 	    IUnknown_Release((LPUNKNOWN)*arg);
 	return hres;
     case VT_VOID:




More information about the wine-cvs mailing list