Skip to content

[desktop_multi_window v0.2.0] Invalid memory access upon app close #342

@isaacy13

Description

@isaacy13

Upon closing app, there are various fatal memory access errors

Reproduce Steps

Steps to reproduce the behavior:

  1. Open an app with desktop_multi_window v0.2.0
  2. Close the app
  3. See crash logs (e.g.: Sentry Native or debug locally with Visual Studio)

Expected behavior

Upon closing app, no memory access violations should occur

image
image

Version (please complete the following information):

  • Flutter Version: v3.19.3
  • OS: Windows
  • plugin: [desktop_multi_window v0.2.0]
Errors occur in C++ library and are not caught by Flutter

Can debug locally with Visual Studio by:
- Open Task Manager
- Right click app
- Debug
- New instance of Visual Studio
Seems like desktop_multi_window objects are trying to be used after Flutter app is closed & memory is deallocated

Challenge might be making sure all objects are destructed before Flutter app is closed

Commenting out WindowChannel destructor code seems to resolve memory access errors, but was hoping for a better solution
Note: repro steps only require main window to be created (and registered) -- no creation of subwindows required to reproduce issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions