Skip to content

Memory Leak (Thread) does not dispose. #129

@ScorpiosCrux

Description

@ScorpiosCrux

Describe the bug
Whenever I put the overlay in the background, a new thread/isolate is created but never disposed.

image

This started happening when I started using:

@pragma("vm:entry-point")
void overlayMain() {
  // Ensure's that the Flutter engine is initialized before any dart calls.
  WidgetsFlutterBinding.ensureInitialized();
  
  runApp(const MaterialApp(
    debugShowCheckedModeBanner: false,
    home: SystemOverlayWidget(),
  ));
}

To Reproduce
Click the circle button to put the app into the background (with circle button), and then reopen the app without closing it (swiping up from square button)

Expected behavior
The overlay thread should be shutdown when the following is called

await SystemAlertWindow.closeSystemWindow(
    prefMode: SystemWindowPrefMode.OVERLAY,
);

Versions (please complete the following information):

  • SystemAlertWindow: 2.0.0
  • Device: Orange Pi 5
  • OS: Android 12

Let me know if you need more information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions