aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx16
1 files changed, 4 insertions, 12 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index 60bdbfee6..73f85e0a9 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -194,9 +194,7 @@ struct FormatAndMetrics {
if (hfont)
::DeleteObject(hfont);
#if defined(USE_D2D)
- if (pTextFormat)
- pTextFormat->Release();
- pTextFormat = nullptr;
+ ReleaseUnknown(pTextFormat);
#endif
extraFontFlag = 0;
characterSet = 0;
@@ -1154,10 +1152,7 @@ SurfaceD2D::~SurfaceD2D() {
}
void SurfaceD2D::Clear() noexcept {
- if (pBrush) {
- pBrush->Release();
- pBrush = nullptr;
- }
+ ReleaseUnknown(pBrush);
if (pRenderTarget) {
while (clipsActive) {
pRenderTarget->PopAxisAlignedClip();
@@ -1165,7 +1160,7 @@ void SurfaceD2D::Clear() noexcept {
}
if (ownRenderTarget) {
pRenderTarget->EndDraw();
- pRenderTarget->Release();
+ ReleaseUnknown(pRenderTarget);
ownRenderTarget = false;
}
pRenderTarget = nullptr;
@@ -1788,10 +1783,7 @@ ScreenLineLayout::ScreenLineLayout(const IScreenLine *screenLine) {
}
ScreenLineLayout::~ScreenLineLayout() {
- if (textLayout) {
- textLayout->Release();
- textLayout = nullptr;
- }
+ ReleaseUnknown(textLayout);
}
// Get the position from the provided x