[PATCH] comctl32/tests: Fix DC handle leak.

Thomas Faber thomas.faber at reactos.org
Tue Nov 23 19:34:44 CST 2021


From 405d9f407db8192f7b3d4079cbe4e2c36bb4391d Mon Sep 17 00:00:00 2001
From: Thomas Faber <thomas.faber at reactos.org>
Date: Tue, 23 Nov 2021 19:08:03 -0500
Subject: comctl32/tests: Fix DC handle leak.

Signed-off-by: Thomas Faber <thomas.faber at reactos.org>
---
 dlls/comctl32/tests/rebar.c   | 2 +-
 dlls/comctl32/tests/toolbar.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/comctl32/tests/rebar.c b/dlls/comctl32/tests/rebar.c
index d0b201a8763..63449d4d457 100644
--- a/dlls/comctl32/tests/rebar.c
+++ b/dlls/comctl32/tests/rebar.c
@@ -70,7 +70,7 @@ static void init_system_font_height(void) {
 
     hDC = CreateCompatibleDC(NULL);
     GetTextMetricsA(hDC, &tm);
-    DeleteDC(NULL);
+    DeleteDC(hDC);
 
     system_font_height = tm.tmHeight;
 }
diff --git a/dlls/comctl32/tests/toolbar.c b/dlls/comctl32/tests/toolbar.c
index 87b4611d056..d238e9f1071 100644
--- a/dlls/comctl32/tests/toolbar.c
+++ b/dlls/comctl32/tests/toolbar.c
@@ -1023,7 +1023,7 @@ static int system_font_height(void) {
 
     hDC = CreateCompatibleDC(NULL);
     GetTextMetricsA(hDC, &tm);
-    DeleteDC(NULL);
+    DeleteDC(hDC);
 
     return tm.tmHeight;
 }
-- 
2.31.1



More information about the wine-devel mailing list