protected override void Dispose(bool disposing)
{
//Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
// Must not be run more than once.
if (IsDisposed)
return;
if (disposing)
{
if (m_viewHelper != null)
m_viewHelper.Dispose();
if (m_app != null)
{
// The removing of the window needs to happen later; after this main window is
// already disposed of. This is needed for side-effects that require a running
// message loop (such as closing the TE notes view which would normally
// happen at this call without a running message loop)
m_app.FwManager.ExecuteAsync(m_app.RemoveWindow, this);
}
}
// NOTE: base.Dispose() may need the FdoCache which RemoveWindow() wants to delete.
base.Dispose(disposing);
m_viewHelper = null;
m_delegate = null;
}