[Win32] Release DPI change callback also on failure - #3563
Merged
HeikoKlare merged 1 commit intoSep 4, 2026
Conversation
Contributor
HeikoKlare
force-pushed
the
dpi-change-callback-disposal
branch
from
September 3, 2026 14:01
7567122 to
aa789c8
Compare
HeikoKlare
marked this pull request as ready for review
September 3, 2026 14:01
The processing of a zoom change can be scheduled asynchronously via a native timer, for which a callback is allocated and released again once the processing has been performed. If the processing fails, the callback is currently not released. Callback slots are a limited resource shared by the whole application. Once they are exhausted, allocating a callback fails, which makes the scheduling of the zoom change processing fall back to performing it synchronously and can break other functionality relying on callbacks as well. The callback is therefore released independently of the outcome of the processing. Assisted-by: Claude Opus 5 <noreply@anthropic.com>
HeikoKlare
force-pushed
the
dpi-change-callback-disposal
branch
from
September 4, 2026 13:33
aa789c8 to
f0004a6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a zoom change is processed asynchronously, a native callback is allocated for the timer triggering the processing and is released again once the processing has been performed. If the processing fails, the callback is never released.
Callback slots are a limited resource shared by the whole application, so repeatedly failing zoom change processing eventually exhausts them. From then on, allocating a callback fails, which makes the scheduling of the zoom change processing silently fall back to performing it synchronously and can break unrelated functionality relying on callbacks as well.
The callback is now released independently of the outcome of the processing. There is no automated test for this, as the leak is only observable by exhausting the application-wide callback pool, which cannot be provoked in a test without affecting everything else running in the same process. The change has no effect on the successful case, in which the callback was already released.
🤖 Generated with Claude Code