audioplayers
audioplayers copied to clipboard
MacOS circular references cause some unexpected exceptions
Checklist
- [X] I read the troubleshooting guide before raising this issue
- [X] I made sure that the issue I am raising doesn't already exist
Current bug behaviour
In the file SwiftAudioplayersDarwinPlugin.swift, the register method creates an instance of SwiftAudioplayersDarwinPlugin that holds the registrar, and the register method calls registrar.addMethodCallDelegate(instance, channel: methods) to register the instance with the registrar.
Circular references have caused some anomalies. Perhaps it is possible to change the attribute definition from var register: FlutterPluginRegister to weak var register: FlutterPluginRegister?
Expected behaviour
Steps to reproduce
No response
Code sample
No response
Affected platforms
iOS, macOS
Platform details
No response
AudioPlayers Version
main
Build mode
No response
Audio Files/URLs/Sources
No response
Screenshots
No response
Logs
No response
Related issues / more information
No response
Working on PR
no way
Good insight, thanks. Perhaps one can look at other platform implementations e.g. video_player
and apply the best practice to the darwin implementation. We appreciate any help from the community!