Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ private sealed unsafe class OleInterfaces :
IDisposable,
IManagedWrapper<IDispatch, IDispatchEx, IOleControlSite, IOleClientSite, IOleWindow, IOleInPlaceSite, ISimpleFrameSite, IVBGetControl, IGetVBAObject, IPropertyNotifySink>
{
private readonly AxHost _host;
private AxHost _host;
private ConnectionPointCookie? _connectionPoint;

internal OleInterfaces(AxHost host) => _host = host.OrThrowIfNull();
Expand All @@ -41,6 +41,9 @@ protected override void Dispose(bool disposing)
{
StopEvents();
}

// If we don't null this out, this will indirectly root the container control.
_host = null!;
}

internal AxHost GetAxHost() => _host;
Expand Down Expand Up @@ -251,7 +254,7 @@ HRESULT IOleControlSite.Interface.ShowPropertyFrame()
// IOleClientSite methods:
HRESULT IOleClientSite.Interface.SaveObject() => HRESULT.E_NOTIMPL;

unsafe HRESULT IOleClientSite.Interface.GetMoniker(uint dwAssign, uint dwWhichMoniker, IMoniker** ppmk)
HRESULT IOleClientSite.Interface.GetMoniker(uint dwAssign, uint dwWhichMoniker, IMoniker** ppmk)
{
if (ppmk is null)
{
Expand All @@ -262,7 +265,7 @@ unsafe HRESULT IOleClientSite.Interface.GetMoniker(uint dwAssign, uint dwWhichMo
return HRESULT.E_NOTIMPL;
}

unsafe HRESULT IOleClientSite.Interface.GetContainer(IOleContainer** ppContainer)
HRESULT IOleClientSite.Interface.GetContainer(IOleContainer** ppContainer)
{
if (ppContainer is null)
{
Expand All @@ -273,7 +276,7 @@ unsafe HRESULT IOleClientSite.Interface.GetContainer(IOleContainer** ppContainer
return HRESULT.S_OK;
}

unsafe HRESULT IOleClientSite.Interface.ShowObject()
HRESULT IOleClientSite.Interface.ShowObject()
{
if (_host.GetAxState(s_fOwnWindow))
{
Expand Down