diff --git a/webf/lib/src/launcher/controller.dart b/webf/lib/src/launcher/controller.dart index 09d2bb42d0..280bb1d2e5 100644 --- a/webf/lib/src/launcher/controller.dart +++ b/webf/lib/src/launcher/controller.dart @@ -222,6 +222,10 @@ class WebFViewController implements WidgetsBindingObserver { return targetId; } + void disposeTargetIdToDevNodeIdMap(BindingObject? object) { + _targetIdToDevNodeIdMap.remove(object?.pointer?.address); + } + int forDevtoolsNodeId(BindingObject object) { int? nativeAddress = object.pointer?.address; if (nativeAddress != null) { @@ -647,8 +651,8 @@ class WebFViewController implements WidgetsBindingObserver { BindingObject? bindingObject = getBindingObject(pointer); bindingObject?.dispose(); view.removeBindingObject(pointer); + view.disposeTargetIdToDevNodeIdMap(bindingObject); malloc.free(pointer); - BindingObject.disposeTargetIdToDevNodeIdMap(); } RenderObject getRootRenderObject() {