https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7989e3f26cafd74c9d8fd…
commit 7989e3f26cafd74c9d8fdeef64deece0da591634
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Jun 15 15:14:32 2023 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Thu Jun 15 15:14:32 2023 +0900
[TASKMGR] GraphCtrl_Dispose: Delete hdcGraph first
The pen might be selected at GraphCtrl_Dispose.
Do not delete a drawing object (pen or brush) while it is still selected into a DC.
CORE-18014
---
base/applications/taskmgr/graphctl.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/base/applications/taskmgr/graphctl.c b/base/applications/taskmgr/graphctl.c
index 78bc157db3d..66cc9e60208 100644
--- a/base/applications/taskmgr/graphctl.c
+++ b/base/applications/taskmgr/graphctl.c
@@ -116,6 +116,9 @@ GraphCtrl_Dispose(PTM_GRAPH_CONTROL inst)
if (inst->PointBuffer)
HeapFree(GetProcessHeap(), 0, inst->PointBuffer);
+ if (inst->hdcGraph)
+ DeleteDC(inst->hdcGraph);
+
if (inst->hPenGrid)
DeleteObject(inst->hPenGrid);
@@ -130,9 +133,6 @@ GraphCtrl_Dispose(PTM_GRAPH_CONTROL inst)
if (inst->hbmGraph)
DeleteObject(inst->hbmGraph);
-
- if (inst->hdcGraph)
- DeleteDC(inst->hdcGraph);
}
void