qt_imageToWinHBITMAP(): properly delete object on error
Properly delete the handle created by CreateDIBSection() with DeleteObject() in case of error. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-18057 Change-Id: Ibf40f6afb255bc5a7d7bf39939f5eb3dfcd19f84 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This commit is contained in:
parent
8d0d520cd3
commit
b37b8eb7ea
@ -305,6 +305,7 @@ HBITMAP qt_imageToWinHBITMAP(const QImage &imageIn, int hbitmapFormat)
|
||||
return nullptr;
|
||||
}
|
||||
if (!pixels) {
|
||||
DeleteObject(bitmap);
|
||||
qErrnoWarning("%s, did not allocate pixel data", __FUNCTION__);
|
||||
return nullptr;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user