Bug Report
The bridge.viewController is not getting released since this plugin hold the strong Reference to the ViewController
on load(), which is leading to retain cycle in iOS .
https://github.com/ionic-team/capacitor-plugins/blob/7.x/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientationPlugin.swift
Inside this class :
https://github.com/ionic-team/capacitor-plugins/blob/7.x/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientation.swift
Please change view controller to weak :
private weak var capViewController: CAPBridgeViewController?
Plugin(s)
Plugin : screen-orientation
https://github.com/ionic-team/capacitor-plugins/blob/main/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientation.swift
Platform(s)
iOS
Expected Behavior
It should be able to access the bridge.viewController as long as it stays in memory
Or
Please provide option or method to close ViewController safely without memory leaks .
Additional :
Same issue is observed with capacitor-barcode-scanner in load() , it passes viewController reference to OSBarcodeLib which strongly holds the viewController
https://github.com/ionic-team/capacitor-barcode-scanner/blob/main/plugin/ios/Sources/CapacitorBarcodeScannerPlugin/CapacitorBarcodeScannerPlugin.swift
Bug Report
The bridge.viewController is not getting released since this plugin hold the strong Reference to the ViewController
on load(), which is leading to retain cycle in iOS .
https://github.com/ionic-team/capacitor-plugins/blob/7.x/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientationPlugin.swift
Inside this class :
https://github.com/ionic-team/capacitor-plugins/blob/7.x/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientation.swift
Please change view controller to weak :
private weak var capViewController: CAPBridgeViewController?Plugin(s)
Plugin : screen-orientation
https://github.com/ionic-team/capacitor-plugins/blob/main/screen-orientation/ios/Sources/ScreenOrientationPlugin/ScreenOrientation.swift
Platform(s)
iOS
Expected Behavior
It should be able to access the bridge.viewController as long as it stays in memory
Or
Please provide option or method to close ViewController safely without memory leaks .
Additional :
Same issue is observed with
capacitor-barcode-scannerin load() , it passes viewController reference toOSBarcodeLibwhich strongly holds the viewControllerhttps://github.com/ionic-team/capacitor-barcode-scanner/blob/main/plugin/ios/Sources/CapacitorBarcodeScannerPlugin/CapacitorBarcodeScannerPlugin.swift