Kaydet (Commit) b7e30878 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

prevent insane memory allocation

We release the memory in the next call again.

Change-Id: I9cd974f2c1b2381d0a895bea52a8654143862971
üst d846fc0c
......@@ -38,6 +38,13 @@ private:
public:
ImpBitmap();
/**
* takes ownership
* same as Sequence:
* pBmp = new ImpBitmap;
* pBmp->ImplSetSalBitmap(pBitmap);
*/
ImpBitmap(SalBitmap* pBitmap);
~ImpBitmap();
void ImplSetSalBitmap( SalBitmap* pSalBitmap );
......
......@@ -31,6 +31,13 @@ ImpBitmap::ImpBitmap() :
{
}
ImpBitmap::ImpBitmap(SalBitmap* pBitmap) :
mnRefCount ( 1 ),
mnChecksum ( 0 ),
mpSalBitmap ( pBitmap )
{
}
ImpBitmap::~ImpBitmap()
{
delete mpSalBitmap;
......
......@@ -457,8 +457,7 @@ Bitmap OutputDevice::GetBitmap( const Point& rSrcPt, const Size& rSize ) const
if( pSalBmp )
{
ImpBitmap* pImpBmp = new ImpBitmap;
pImpBmp->ImplSetSalBitmap( pSalBmp );
ImpBitmap* pImpBmp = new ImpBitmap(pSalBmp);
aBmp.ImplSetImpBitmap( pImpBmp );
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment