Jacek Caban : mshtml: Increment ref count in QI(IID_HTMLPluginContainer) call.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Apr 13 07:42:02 CDT 2015


Module: wine
Branch: master
Commit: 81c13caf375634d49dba699dd84e7bf172954297
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=81c13caf375634d49dba699dd84e7bf172954297

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Mon Apr 13 13:26:26 2015 +0200

mshtml: Increment ref count in QI(IID_HTMLPluginContainer) call.

---

 dlls/mshtml/htmlobject.c | 2 ++
 dlls/mshtml/script.c     | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/mshtml/htmlobject.c b/dlls/mshtml/htmlobject.c
index e7dbe9a..2633f48 100644
--- a/dlls/mshtml/htmlobject.c
+++ b/dlls/mshtml/htmlobject.c
@@ -658,8 +658,10 @@ static HRESULT HTMLObjectElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
         TRACE("(%p)->(IID_IHTMLObjectElement2 %p)\n", This, ppv);
         *ppv = &This->IHTMLObjectElement2_iface;
     }else if(IsEqualGUID(&IID_HTMLPluginContainer, riid)) {
+        /* Special pseudo-interface returning HTMLPluginContainse struct. */
         TRACE("(%p)->(IID_HTMLPluginContainer %p)\n", This, ppv);
         *ppv = &This->plugin_container;
+        node_addref(&This->plugin_container.element.node);
         return S_OK;
     }else {
         HRESULT hres;
diff --git a/dlls/mshtml/script.c b/dlls/mshtml/script.c
index 757036c..4590854 100644
--- a/dlls/mshtml/script.c
+++ b/dlls/mshtml/script.c
@@ -1509,8 +1509,11 @@ void bind_event_scripts(HTMLDocumentNode *doc)
                 else
                     bind_node_event(doc, event_target, target_node, event, event_disp);
 
-                if(target_node)
+                if(target_node) {
                     IHTMLDOMNode_Release(&target_node->IHTMLDOMNode_iface);
+                    if(plugin_container)
+                        node_release(&plugin_container->element.node);
+                }
             }
 
             heap_free(event);




More information about the wine-cvs mailing list