-
-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Hi, i'm working on a personal project and noticed that when you hot restart (not hot reload) the app and try to connect to a previously connected native device, you get an OPEN ERROR(4): Resource already allocated message on the console. the issue comes from WindowsMidiDevice midiInOpen throwing MMSYSERR_ALLOCATED. Since the only thing that gets restarted it's the app's state and not the plugins/external resources, i'd assume that a memory freeing function could be exposed in the API and let the user handle the rest, or maybe clear the resources before trying a new connection.
I tried disconnectDevice after restart but it doesn't remember having any native device being previously connected so it does nothing, also tried teardown.
You can reproduce it on the example app by:
- Connecting to native device A
- Hot restarting the app
- Connecting to native device A
flutter doctor:
[√] Flutter (Channel master, 3.28.0-2.0.pre.38574, on Microsoft Windows [Version 10.0.22631.4317],
locale en-US)
[√] Windows Version (11 Pro 64-bit, 23H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Build Tools 2022 17.4.3)
[√] Android Studio (version 2024.1)
[√] VS Code (version 1.96.2)
[√] Connected device (3 available)
[√] Network resources