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

Noel Grandin noel at peralex.com
Thu May 5 12:03:16 UTC 2016


 vcl/source/gdi/wall.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit f84d9ae0c9edbf5395aa8c9171c0fa1e1a41a6ab
Author: Noel Grandin <noel at peralex.com>
Date:   Thu May 5 12:11:46 2016 +0200

    fix crash in WallpaperImpl destructor
    
    after commit b6f3b2b0ab9404917b7805bb89701c110b468768
    "tdf#62525 vcl: use cow_wrapper for wall"
    
    OutputDevice::DrawBitmapWallpaper passes a stack allocated object to
    Wallpaper::ImplSetCachedBitmap, which in turns takes a pointer to that
    object, and then unconditionally deletes that object in it's destructor.
    
    The original code did a
       *mpCache = rBmp
    so restore that.
    
    Change-Id: Ie65fb84e48750bb2c698dc08e0b6c5c7a0dea694

diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx
index f69e3ab..7f81368 100644
--- a/vcl/source/gdi/wall.cxx
+++ b/vcl/source/gdi/wall.cxx
@@ -202,10 +202,9 @@ Wallpaper::~Wallpaper()
 
 void Wallpaper::ImplSetCachedBitmap( BitmapEx& rBmp ) const
 {
-    if( !mpImplWallpaper->mpCache )
-        const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache = new BitmapEx( rBmp );
-    else
-        const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache = &rBmp;
+    if( mpImplWallpaper->mpCache )
+        delete const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache;
+    const_cast< ImplWallpaper* >(mpImplWallpaper.get())->mpCache = new BitmapEx( rBmp );
 }
 
 const BitmapEx* Wallpaper::ImplGetCachedBitmap() const


More information about the Libreoffice-commits mailing list