Skip to content

Calling EventChannel::SetStreamHandler in plugin destructor causes crash #118611

@jnschulze

Description

@jnschulze

Calling EventChannel::SetStreamHandler (or MethodChannel::SetMethodCallHandler, respectively) in a plugin destructor causes an access violation:

image

While this is trivial to work around by not unsetting the stream handler, I think doing so should not be illegal.

Minimal reproducible example:
https://github.com/jnschulze/flutter-playground/blob/78c36485f3457b9de687b7e4b94c116d9b117176/eventchannel_win/windows/eventchannel_win_plugin.cpp#L57

Flutter version:

Flutter 3.7.0-21.0.pre.38 • channel master • https://github.com/flutter/flutter.git
Framework • revision 68dd63d66b (4 days ago) • 2023-01-13 15:34:33 -0800
Engine • revision a512cebdcd
Tools • Dart 3.0.0 (build 3.0.0-122.0.dev) • DevTools 2.20.0

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopplatform-windowsBuilding on or for Windows specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions