sfx2/qa/complex/sfx2/UndoManager.java |    4 ++--
 vcl/inc/win/saldata.hxx               |    2 ++
 vcl/win/source/gdi/salgdi.cxx         |    7 +++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit cc29ff5f3435b3bcd028f551b654d44d7c137b57
Author: Tor Lillqvist <t...@collabora.com>
Date:   Tue Jun 3 23:36:18 2014 +0300

    Avoid accessing freed memory and freeing already freed resources
    
    Seen in smoketest a 4.2-based branch, but might perhaps happen in master
    too. Should not hurt in any case to be more careful. ImplFreeSalGDI() is
    called both from SalAbort() and from DestroySalInstance().
    
    Change-Id: Ifac37e8ecfb432848bd3451dbda8634c59a06fba

diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx
index d1464d5..1d54637 100644
--- a/vcl/inc/win/saldata.hxx
+++ b/vcl/inc/win/saldata.hxx
@@ -70,6 +70,8 @@ public:
     // checks if the menuhandle was created by VCL
     sal_Bool    IsKnownMenuHandle( HMENU hMenu );
 
+    bool                    mbResourcesAlreadyFreed;
+
 public:
     HINSTANCE               mhInst;                 // default instance handle
     HINSTANCE               mhPrevInst;             // previous instance handle
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index e3a660f..5d1cd35 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -136,6 +136,8 @@ void ImplInitSalGDI()
 {
     SalData* pSalData = GetSalData();
 
+    pSalData->mbResourcesAlreadyFreed = false;
+
     // init stock brushes
     pSalData->maStockPenColorAry[0]     = PALETTERGB( 0, 0, 0 );
     pSalData->maStockPenColorAry[1]     = PALETTERGB( 0xFF, 0xFF, 0xFF );
@@ -315,6 +317,9 @@ void ImplFreeSalGDI()
 {
     SalData*    pSalData = GetSalData();
 
+    if (pSalData->mbResourcesAlreadyFreed)
+        return;
+
     // destroy stock objects
     int i;
     for ( i = 0; i < pSalData->mnStockPenCount; i++ )
@@ -381,6 +386,8 @@ void ImplFreeSalGDI()
 
     // delete temporary font list
     ImplReleaseTempFonts( *pSalData );
+
+    pSalData->mbResourcesAlreadyFreed = true;
 }
 
 // -----------------------------------------------------------------------
commit 02a9c1a3b3ecb07d3b4b9db4d86dba2fefbd187d
Author: Michael Stahl <mst...@redhat.com>
Date:   Tue Nov 26 23:08:21 2013 +0100

    adapt sfx2 UndoManager test to renaming from "click" to "press"
    
    RID_STR_ACC_ACTION_CLICK in efb23f29983f87104a684e7fab00b84fc59d131d
    
    Change-Id: If684816602db38fa87b6272c0491ab2ac910aece

diff --git a/sfx2/qa/complex/sfx2/UndoManager.java 
b/sfx2/qa/complex/sfx2/UndoManager.java
index 69c9dd2..901c6c4 100644
--- a/sfx2/qa/complex/sfx2/UndoManager.java
+++ b/sfx2/qa/complex/sfx2/UndoManager.java
@@ -429,13 +429,13 @@ public class UndoManager
         final XAccessibleAction controlActions = UnoRuntime.queryInterface( 
XAccessibleAction.class, accessible.getAccessibleContext() );
         for ( int i=0; i<controlActions.getAccessibleActionCount(); ++i )
         {
-            if ( controlActions.getAccessibleActionDescription(i).equals( 
"click" ) )
+            if 
(controlActions.getAccessibleActionDescription(i).equals("press"))
             {
                 controlActions.doAccessibleAction(i);
                 return;
             }
         }
-        fail( "did not find the accessible action named 'click'" );
+        fail("did not find the accessible action named 'press'");
     }
 
     // 
-----------------------------------------------------------------------------------------------------------------
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to