diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx index 4b4b204ce4fe..2a17f5140771 100644 --- a/vcl/source/gdi/image.cxx +++ b/vcl/source/gdi/image.cxx @@ -168,7 +168,6 @@ void Image::ImplInit( const BitmapEx& rBmpEx ) if( !rBmpEx.IsEmpty() ) { mpImplData = new ImplImage; - mpImplData->mnRefCount = 1; if( rBmpEx.GetTransparentType() == TRANSPARENT_NONE ) { @@ -365,7 +364,6 @@ ImageList::ImageList( const ImageList& rImageList ) : ImageList::~ImageList() { - if( mpImplData && ( 0 == --mpImplData->mnRefCount ) ) delete mpImplData; } @@ -373,7 +371,6 @@ ImageList::~ImageList() void ImageList::ImplInit( sal_uInt16 nItems, const Size &rSize ) { mpImplData = new ImplImageList; - mpImplData->mnRefCount = 1; mpImplData->maImages.reserve( nItems ); mpImplData->maImageSize = rSize; } diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx index f61a34588f27..7f77d10a07cd 100644 --- a/vcl/source/gdi/impimage.cxx +++ b/vcl/source/gdi/impimage.cxx @@ -58,13 +58,14 @@ ImageAryData& ImageAryData::operator=( const ImageAryData& rData ) } ImplImageList::ImplImageList() + : mnRefCount(1) { } -ImplImageList::ImplImageList( const ImplImageList &aSrc ) : - maPrefix( aSrc.maPrefix ), - maImageSize( aSrc.maImageSize ), - mnRefCount( 1 ) +ImplImageList::ImplImageList( const ImplImageList &aSrc ) + : maPrefix(aSrc.maPrefix) + , maImageSize(aSrc.maImageSize) + , mnRefCount(1) { maImages.reserve( aSrc.maImages.size() ); for ( ImageAryDataVec::const_iterator aIt = aSrc.maImages.begin(), aEnd = aSrc.maImages.end(); aIt != aEnd; ++aIt ) @@ -116,6 +117,7 @@ sal_Bool ImplImageData::IsEqual( const ImplImageData& rData ) } ImplImage::ImplImage() + : mnRefCount(1) { }