DC attributes are not deallocated when free_dc_attr is called on them but are instead queued for reassignment. If we don't make use of the designated allocator to allocate DC attributes, we essentially keep adding memory to the queue indefinitely and, at the same time, not allowing room for reassignment.
The above essentially leads to a leak which is quite noticeable in applications making use heavy use of gdiplus.
From: David Kahurani k.kahurani@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=53645 --- dlls/win32u/dc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/win32u/dc.c b/dlls/win32u/dc.c index 60229bb2f89..300ae2a1153 100644 --- a/dlls/win32u/dc.c +++ b/dlls/win32u/dc.c @@ -543,7 +543,7 @@ INT WINAPI NtGdiSaveDC( HDC hdc ) release_dc_ptr( dc ); return 0; } - if (!(newdc->attr = calloc( 1, sizeof(*newdc->attr) ))) + if (!(newdc->attr = alloc_dc_attr() )) { free( newdc ); release_dc_ptr( dc );
This merge request was approved by Jacek Caban.
This merge request was approved by Huw Davies.