Dispose the devices the adapter creates for its own event replay - #87
Open
Kinchul wants to merge 1 commit into
Open
Dispose the devices the adapter creates for its own event replay#87Kinchul wants to merge 1 commit into
Kinchul wants to merge 1 commit into
Conversation
Kinchul
force-pushed
the
vk/dispose-replayed-devices
branch
from
August 18, 2026 10:52
5301681 to
d51f69f
Compare
Kinchul
force-pushed
the
vk/dispose-replayed-devices
branch
from
August 18, 2026 12:25
d51f69f to
009ee7c
Compare
Kinchul
force-pushed
the
vk/dispose-replayed-devices
branch
from
August 18, 2026 12:26
009ee7c to
0b334d0
Compare
Kinchul
marked this pull request as ready for review
August 18, 2026 12:31
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.
Details
Mostly documentation, plus one small fix.
Every
Deviceregisters a D-Bus match rule inDevice.CreateAsync, and that rule is released only when theDeviceis disposed. A connection is limited tomax_match_rules_per_connection(2048 by default), so a consumer that discards the devices it receives eventually exhausts the limit and BlueZ calls start failing.DeviceisIDisposable, but nothing stated that the devices delivered byDeviceFoundand returned byGetDevicesAsync,GetDeviceAsyncandWatchDevicesAddedAsyncbelong to the caller. This documents it on all four. We spent a long time tracking that down in #19, where the measurements are.The one code change:
TrackDeviceForConnectionleft itsDeviceundisposed when tracking failed after creation. Thecatchreleases the reserved slot, so nothing else can reach that device afterwards.No API or behaviour change.