dtrans: reset DropTarget::m_pDropTarget if it is released
JunitTest_forms_unoapi_3 just crashed in DropTarget::disposing() with m_pDropTarget pointing to garbage. Change-Id: Icb5ad15a3d4b857b45553543d404e14abbac4374
This commit is contained in:
@@ -87,6 +87,7 @@ void SAL_CALL DropTarget::disposing()
|
|||||||
{
|
{
|
||||||
CoLockObjectExternal( m_pDropTarget, FALSE, TRUE);
|
CoLockObjectExternal( m_pDropTarget, FALSE, TRUE);
|
||||||
m_pDropTarget->Release();
|
m_pDropTarget->Release();
|
||||||
|
m_pDropTarget = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_oleThreadId)
|
if( m_oleThreadId)
|
||||||
@@ -171,6 +172,7 @@ void SAL_CALL DropTarget::initialize( const Sequence< Any >& aArguments )
|
|||||||
// do clean up if drag and drop is not possible
|
// do clean up if drag and drop is not possible
|
||||||
CoLockObjectExternal( m_pDropTarget, FALSE, FALSE);
|
CoLockObjectExternal( m_pDropTarget, FALSE, FALSE);
|
||||||
m_pDropTarget->Release();
|
m_pDropTarget->Release();
|
||||||
|
m_pDropTarget = nullptr;
|
||||||
m_hWnd= NULL;
|
m_hWnd= NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,6 +221,7 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams)
|
|||||||
// do clean up if drag and drop is not possible
|
// do clean up if drag and drop is not possible
|
||||||
CoLockObjectExternal( pTarget->m_pDropTarget, FALSE, FALSE);
|
CoLockObjectExternal( pTarget->m_pDropTarget, FALSE, FALSE);
|
||||||
pTarget->m_pDropTarget->Release();
|
pTarget->m_pDropTarget->Release();
|
||||||
|
pTarget->m_pDropTarget = nullptr;
|
||||||
pTarget->m_hWnd= NULL;
|
pTarget->m_hWnd= NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user