audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

MacOS circular references cause some unexpected exceptions

Open qzlong opened this issue 9 months ago • 1 comments

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? image

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

qzlong avatar May 08 '24 05:05 qzlong

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!

Gustl22 avatar May 13 '24 11:05 Gustl22