http://bugs.winehq.org/show_bug.cgi?id=16909
Summary: memory leak in function SetWindowRgn (?) Product: Wine Version: CVS/GIT Platform: All OS/Version: All Status: UNCONFIRMED Severity: normal Priority: P2 Component: user32 AssignedTo: wine-bugs@winehq.org ReportedBy: psedov@gmail.com
Wine's implementation of WinAPI function SetWindowRgn (http://source.winehq.org/git/wine.git/?a=blob;f=dlls/user32/winpos.c;h=d680c...): ---------------- if (hrgn) { RGNDATA *data; DWORD size;
if (!(size = GetRegionData( hrgn, 0, NULL ))) return FALSE; if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) return FALSE; if (!GetRegionData( hrgn, size, data )) { HeapFree( GetProcessHeap(), 0, data ); return FALSE; } SERVER_START_REQ( set_window_region ) { req->window = wine_server_user_handle( hwnd ); req->redraw = (bRedraw != 0); if (data->rdh.nCount) wine_server_add_data( req, data->Buffer, data->rdh.nCount * sizeof(RECT) ); else wine_server_add_data( req, &empty_rect, sizeof(empty_rect) ); ret = !wine_server_call_err( req ); } SERVER_END_REQ; } ---------------- Variable 'data' points to memory block allocated via WinAPI function HeapAlloc. But I don't see where that memory block is freed via WinAPI function HeapFree. Is this a bug (memory leak) or am I just misunderstanding the code?
I posted this question to Google group comp.emulators.ms-windows.wine (http://groups.google.ru/group/comp.emulators.ms-windows.wine/browse_thread/t...), but nobody responded, so I'm re-asking it here.