Closed hussien89aa closed 2 years ago
Also please be aware of the way you use SetWindowRgn it doesn't delete objects all time For safe delete, you need to use a pattern like this to make sure object is deleted if the window is not set
HRGN regin1 = CreateRectRgn(0, 0, 10, 10);
BOOL created = SetWindowRgn(hWnd, regin1, TRUE);
if (!created)
{
DeleteObject(regin1);
}
Going to send one PR that fixes all leak issues.
I work for the Microsoft Graphics team, and I notice that your app is leaking GDI objects. These leaks make your app crash suddenly on the user. Once your all use all quotes for GDI object per process because of the leak the app will crash. Please fix/verify PR as soon as possible. I address leaks as much as I can I am not sure I address all leaks please find other leaks if there are any and fix them, your app is a good and nice App.
Leak issue fixed
When you use CombineRgn to combine three areas
CombineRgn(region_Both, region_ShellTrayWnd, region_TrayNotifyWnd, RGN_OR);
you need delete the old two (region_ShellTrayWnd, region_TrayNotifyWnd
) since nobody can delete them. Even SetWindowRgn going to delete new arearegion_Both
only old you need to delete them Thanks Hussein