Skip to content

ContentPage with ToolbarItem Clicked event leaks when presented as modal page #34892

@Vetle444

Description

@Vetle444

Description

A ContentPage that has a ToolbarItem with a Clicked event handler is not garbage collected after being dismissed when presented modally via Navigation.PushModalAsync. The same page is collected correctly when pushed via Navigation.PushAsync.

Image

Steps to Reproduce

  1. Create a ContentPage with a ToolbarItem that has a Clicked event handler
  2. Push it modally via Navigation.PushModalAsync(new NavigationPage(page))
  3. Dismiss it via Navigation.PopModalAsync()
  4. Repeat a few times
  5. Force GC and check if pages were collected

Link to public reproduction project repository

https://github.com/Vetle444/MauiTestApp/tree/toolbarMemoryLeak

Version with bug

10.0.50

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

Android, iOS

Affected platform versions

No response

Did you find any workaround?

Use Command instead

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    i/regressionThis issue described a confirmed regression on a currently supported versionpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/androidplatform/iosregressed-in-10-preview1s/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions