You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[pigeon] Provide a way to remove event channel handlers #195049
Pigeon's event channel register method internally registers an event channel handler with the engine, but doesn't provide any mechanism for removing it. This means that native handlers for channels that have a shorter lifespan than the engine (e.g., video_player player instances) will accumulate over time.
I think the simplest solution, and the one that is consistent with other Pigeon registration APIs, is to just make the handler parameter nullable, and handle nulls as setting a nil handler for that channel on the engine. It shouldn't be necessary to save the actual underlying event channel object for re-use, because internally it's just a name-based binding on the engine itself that's just mediated by the channel object.
This applies to both the Kotlin and Swift generators.
It shouldn't be necessary to save the actual underlying event channel object for re-use, because internally it's just a name-based binding on the engine itself that's just mediated by the channel object.
Apparently on iOS/macOS at least, this is no longer true. I'm pretty sure it was originally, but now there's an identifier owned by the event channel instance that's used for unregistering, so this will require a different approach.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
stuartmorgan commentedon Oct 24, 2026
Apparently on iOS/macOS at least, this is no longer true. I'm pretty sure it was originally, but now there's an identifier owned by the event channel instance that's used for unregistering, so this will require a different approach.
[pigeon] Allow event channel unregistration (#13438)
github-actions commentedon Nov 13, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.