Skip to content

[ios] Leaking FlutterTouchInterceptingViews #69305

@iskakaushik

Description

@iskakaushik

Looks like there are some FlutterTouchInterceptingViews that are unbound to the root FlutterView. There is an invariant mentioned for root_views_.

// Mapping a platform view ID to the top most parent view (root_view) who is a direct child to the `flutter_view_`.

But there are some instances in the code where the invariant doesn't seem to be maintained. Here is a pseudo excerpt from https://github.com/flutter/engine/blob/master/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm#L165

  FlutterTouchInterceptingView* touch_interceptor = create;
  touch_interceptors_[viewId] = retain touch_interceptor;
  ChildClippingView* clipping_view = create;
  [clipping_view addSubview:touch_interceptor];
  root_views_[viewId] = retain child clipping view;

I wasn't able to see any binding to the root flutter view in this chain. This was also seen when I ran a memory graph to notice that these were indeed retained.

image

cc: @cyanglaz

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsengineflutter/engine related. See also e: labels.platform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions