[PATCH libreoffice-4-0] Resolves: fdo#62287 avoid a crash on OSX on reusing a dead A...

Caolán McNamara (via_Code_Review) gerrit at gerrit.libreoffice.org
Tue Apr 9 12:31:49 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3295

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/95/3295/1

Resolves: fdo#62287 avoid a crash on OSX on reusing a dead AquaSalFrame

part 1 of 3:

Resolves: #i120237# workaround a crash on OSX...

when a VirtualDevice is reused that was created for a now dead window

regression was introduced by the changes for #i116758#

Patch-By: Herbert Duerr
Suggested-By: Herbert Duerr
Found-By: Herbert Duerr
(cherry picked from commit 6550c7c0595670c10e340e2c7b41be7e128af40a)

(cherry picked from commit 5333d295225e4cf961e03ea8bf2fd1e2f9d168bc)

part 2 of 3:

Related: #i120237# cache the updated frame reference in AquaSalGraphics

(cherry picked from commit 6e4214e604f8aa86b08a7fbe315a80d7751ffc2d)

(cherry picked from commit ef4b5aad82da7133e89e37e3e04791398d6fb3a6)

part 3 of 3:

Related: fdo#62287 make it impossible to use a dead AquaSalFrame

(cherry picked from commit 43a23fb3f8f1ffa4937658dd9393d23533b84d18)

d10d49737ba773e95a3198997e25fbfd98708f65
e56a41e901ea26d5ea946260bdf25a903185be99

Change-Id: I1a813f128ad16e6eb840b22fbd14af49b34e11d0
---
M vcl/aqua/source/gdi/salvd.cxx
1 file changed, 16 insertions(+), 2 deletions(-)



diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx
index 9696b9a..b129f06 100644
--- a/vcl/aqua/source/gdi/salvd.cxx
+++ b/vcl/aqua/source/gdi/salvd.cxx
@@ -184,8 +184,22 @@
     {
         // default to a NSView target context
         AquaSalFrame* pSalFrame = mpGraphics->getGraphicsFrame();
-        if( !pSalFrame && !GetSalData()->maFrames.empty() )
-            pSalFrame = *GetSalData()->maFrames.begin();
+        if( !pSalFrame || !AquaSalFrame::isAlive( pSalFrame ))
+        {
+            if( !GetSalData()->maFrames.empty() )
+            {
+                // get the first matching frame
+                pSalFrame = *GetSalData()->maFrames.begin();
+            }
+            else
+            {
+                // ensure we don't reuse a dead AquaSalFrame on the very
+                // unlikely case of no other frame to use
+                pSalFrame = NULL;
+            }
+            // update the frame reference
+            mpGraphics->setGraphicsFrame( pSalFrame );
+        }
         if( pSalFrame )
         {
             // #i91990#

-- 
To view, visit https://gerrit.libreoffice.org/3295
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a813f128ad16e6eb840b22fbd14af49b34e11d0
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Caolán McNamara <caolanm at redhat.com>



More information about the LibreOffice mailing list