mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[COMCTL32][USER32] EDIT & ListView & TreeView: Fix HRGN leaks (#6268)
Based on KRosUser's memleak_comctl32.patch. JIRA issue: CORE-19405 Fix HRGN handle leaks.
This commit is contained in:
parent
77c5aea41f
commit
90432c1a4c
4 changed files with 6 additions and 2 deletions
|
@ -2568,7 +2568,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r
|
|||
abs(es->selection_end - es->selection_start) - strl, hrgn);
|
||||
strl = 0;
|
||||
e = s;
|
||||
hrgn = CreateRectRgn(0, 0, 0, 0);
|
||||
SetRectRgn(hrgn, 0, 0, 0, 0);
|
||||
if (!notify_parent(es, EN_MAXTEXT)) return;
|
||||
}
|
||||
}
|
||||
|
@ -3734,6 +3734,8 @@ static void EDIT_WM_NCPaint(HWND hwnd, HRGN region)
|
|||
|
||||
/* Call default proc to get the scrollbars etc. also painted */
|
||||
DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
if (cliprgn != region)
|
||||
DeleteObject(cliprgn);
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
|
|
|
@ -10817,6 +10817,7 @@ static BOOL LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region)
|
|||
|
||||
/* Call default proc to get the scrollbars etc. painted */
|
||||
DefWindowProcW (infoPtr->hwndSelf, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
DeleteObject(cliprgn);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -5482,6 +5482,7 @@ static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM
|
|||
|
||||
/* Call default proc to get the scrollbars etc. painted */
|
||||
DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0);
|
||||
DeleteObject(cliprgn);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -2761,7 +2761,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac
|
|||
abs(es->selection_end - es->selection_start) - strl, hrgn);
|
||||
strl = 0;
|
||||
e = s;
|
||||
hrgn = CreateRectRgn(0, 0, 0, 0);
|
||||
SetRectRgn(hrgn, 0, 0, 0, 0);
|
||||
if (!notify_parent(es, EN_MAXTEXT)) return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue