[Libreoffice-commits] core.git: dtrans/source

Michael Stahl mstahl at redhat.com
Tue Jul 28 08:32:01 PDT 2015


 dtrans/source/win32/dnd/target.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 372d416692e0f5a6f1a3a97ff6f967eaab54233c
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue Jul 28 17:20:57 2015 +0200

    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

diff --git a/dtrans/source/win32/dnd/target.cxx b/dtrans/source/win32/dnd/target.cxx
index cd051ba..bc5b649 100644
--- a/dtrans/source/win32/dnd/target.cxx
+++ b/dtrans/source/win32/dnd/target.cxx
@@ -87,6 +87,7 @@ void SAL_CALL DropTarget::disposing()
     {
         CoLockObjectExternal( m_pDropTarget, FALSE, TRUE);
         m_pDropTarget->Release();
+        m_pDropTarget = nullptr;
     }
 
     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
                     CoLockObjectExternal( m_pDropTarget, FALSE, FALSE);
                     m_pDropTarget->Release();
+                    m_pDropTarget = nullptr;
                     m_hWnd= NULL;
                 }
             }
@@ -219,6 +221,7 @@ DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams)
                         // do clean up if drag and drop is not possible
                         CoLockObjectExternal( pTarget->m_pDropTarget, FALSE, FALSE);
                         pTarget->m_pDropTarget->Release();
+                        pTarget->m_pDropTarget = nullptr;
                         pTarget->m_hWnd= NULL;
                     }
                 }


More information about the Libreoffice-commits mailing list