diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-05 12:11:46 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-05 14:02:40 +0200 |
commit | f84d9ae0c9edbf5395aa8c9171c0fa1e1a41a6ab (patch) | |
tree | 49e800ff1af99968d4173821854af7c4d3c5e410 /vcl/source/gdi | |
parent | 877f6bbf4bec5501443365cadbf9bee94a00d9f8 (diff) |
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
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/wall.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vcl/source/gdi/wall.cxx b/vcl/source/gdi/wall.cxx index f69e3ab594e6..7f81368f67b2 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 |