Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged PR 3695437: Fix leak of the region GDI handle
`CRgnHandle rgn` leaks the region created by the `CreateRectRgnIndirect` method in each OnPaint method call. This means, that if the download takes a while and we exhaust the GDI object limit, then `CreateRectRgnIndirect` will fail and bootstrapper would crash. It seems that this code had been there since 2015. I'd guess it's a bad copy-paste from other places where `CreateRectRgnIndirect`. Changing `rgn` to be of type `CRgn` ensures that `DeleteObject` is called when the object goes out of scope. Related work items: #23349119
- Loading branch information