Module: wine Branch: master Commit: 55b9b2f675af9e45a139cd64947a9fe50463aed1 URL: https://gitlab.winehq.org/wine/wine/-/commit/55b9b2f675af9e45a139cd64947a9fe...
Author: Piotr Caban piotr@codeweavers.com Date: Fri May 19 13:38:27 2023 +0200
gdi32: Mark objects as not used before clearing handles table in emf_reset.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54936
---
dlls/gdi32/emfdc.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/gdi32/emfdc.c b/dlls/gdi32/emfdc.c index 5c3d01e43b1..57f39e4c162 100644 --- a/dlls/gdi32/emfdc.c +++ b/dlls/gdi32/emfdc.c @@ -2521,7 +2521,11 @@ static void emf_reset( DC_ATTR *dc_attr, const RECT *rect ) { struct emf *emf = get_dc_emf( dc_attr ); HDC hdc = dc_attr_handle( dc_attr ); + int i;
+ for (i = 0; i < emf->handles_size; i++) + if (emf->handles[i]) + GDI_hdc_not_using_object( emf->handles[i], dc_attr_handle( emf->dc_attr )); memset( emf->handles, 0, emf->handles_size * sizeof(emf->handles[0]) ); emf->cur_handles = 1; emf->file = 0;