mirror of
https://github.com/reactos/reactos.git
synced 2024-08-08 04:08:29 +00:00
BITMAPOBJ_CopyBitmap:
- release lock on failure - delete created bitmap on failure - copy flags, fixes a memory leak svn path=/trunk/; revision=32335
This commit is contained in:
parent
ed323f3711
commit
8e61015f65
|
@ -664,13 +664,21 @@ BITMAPOBJ_CopyBitmap(HBITMAP hBitmap)
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
{
|
{
|
||||||
GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap);
|
GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap);
|
||||||
|
GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap);
|
||||||
|
NtGdiDeleteObject(res);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
IntGetBitmapBits (Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
|
IntGetBitmapBits (Bitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
|
||||||
IntSetBitmapBits (resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
|
IntSetBitmapBits (resBitmap, bm.bmWidthBytes * abs(bm.bmHeight), buf);
|
||||||
ExFreePool (buf);
|
ExFreePool (buf);
|
||||||
|
resBitmap->flFlags = Bitmap->flFlags;
|
||||||
GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap);
|
GDIOBJ_UnlockObjByPtr(GdiHandleTable, resBitmap);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NtGdiDeleteObject(res);
|
||||||
|
res = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap);
|
GDIOBJ_UnlockObjByPtr(GdiHandleTable, Bitmap);
|
||||||
|
|
Loading…
Reference in a new issue