summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-11 13:13:24 +0000
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-11 06:26:16 +0000
commit1061de77bb8927defb372df31899fddc7ace237d (patch)
treeae08efb564d1513355914a250e57e61ddd7a7553
parentb91daa441cb9607c80ff8eeb48064ed57190c2bd (diff)
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 Reviewed-on: https://gerrit.libreoffice.org/3295 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--vcl/aqua/source/gdi/salvd.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx
index 9696b9a83651..b129f06370d1 100644
--- a/vcl/aqua/source/gdi/salvd.cxx
+++ b/vcl/aqua/source/gdi/salvd.cxx
@@ -184,8 +184,22 @@ sal_Bool AquaSalVirtualDevice::SetSize( long nDX, long nDY )
{
// 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#