Windows: QWindowsPrintDevice::printableMargins avoids leaking the DC
MSDN says if the DC was created by calling CreateDC, it must be freed by DeleteDC not ReleaseDC. Task-number: QTBUG-41941 Change-Id: I4c60b5d2587f1c4d3332fce74224cbc8b756eb2a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
56bb02ade3
commit
28857e7ad0
@ -271,7 +271,7 @@ QMarginsF QWindowsPrintDevice::printableMargins(const QPageSize &pageSize,
|
||||
const qreal rightMargin = physicalWidth - leftMargin - printableWidth;
|
||||
const qreal bottomMargin = physicalHeight - topMargin - printableHeight;
|
||||
margins = QMarginsF(leftMargin, topMargin, rightMargin, bottomMargin);
|
||||
ReleaseDC(NULL, pDC);
|
||||
DeleteDC(pDC);
|
||||
}
|
||||
return margins;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user