Skip to content

[web][Link] Cleanup event listeners on hot restart #148133

@mdebbar

Description

@mdebbar

When the Link widget is used, it attaches some global event listeners. These listeners are leaked when a hot-restart occurs.

My first (failing) attempt was:

developer.registerExtension('ext.flutter.disassemble', (_, __) {
  _detachGlobalListeners();
  return Future<developer.ServiceExtensionResponse>.value(
    developer.ServiceExtensionResponse.result('OK'),
  );
});

but it throws the following error:

Invalid argument(s): Extension already registered: ext.flutter.disassemble

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listp: url_launcherPlugin to launch external applicationsplatform-webWeb applications specificallyt: hot reloadReloading code during "flutter run"team-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions