Fix problems with reference counting in wxActiveXContainer.
Ensure that the IFrameSite object is created with valid (i.e. non-zero) reference count by calling AddRef() on it immediately after creation and remove the weird QueryInterface() call which was used to work around this bug. Closes #11566. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -928,6 +928,7 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
|
||||
|
||||
// FrameSite
|
||||
m_frameSite = new FrameSite(m_realparent, this);
|
||||
m_frameSite->AddRef();
|
||||
// oleClientSite
|
||||
hret = m_clientSite.QueryInterface(
|
||||
IID_IOleClientSite, (IDispatch *) m_frameSite);
|
||||
@@ -1030,8 +1031,6 @@ void wxActiveXContainer::CreateActiveX(REFIID iid, IUnknown* pUnk)
|
||||
|
||||
if ( cp )
|
||||
{
|
||||
IDispatch* disp;
|
||||
m_frameSite->QueryInterface(IID_IDispatch, (void**)&disp);
|
||||
hret = cp->Advise(new wxActiveXEvents(this, ta->guid),
|
||||
&adviseCookie);
|
||||
CHECK_HR(hret);
|
||||
|
Reference in New Issue
Block a user