Closed MKuckert closed 6 years ago
This sounds like https://bugzilla.xamarin.com/show_bug.cgi?id=34242. Can you try the workaround at the end of the comment her: https://bugzilla.xamarin.com/show_bug.cgi?id=34242#c9 and see if that works for you?
We have not received the requested information. If you are still experiencing this issue please provide all the requested information then click the Reopen Issue button. Thanks!
Just for completeness: we've a workaround in the field but experience crashes and are currently reviving our code for implementation errors
We also exeperiencing this problem. Our system is discovering every 150ms a CBPeripheral from 1 of 10 Devices. When you save every CBPeripheral in a static List during a 10 s scan intervall you will have up to 1000 CBPeripheral objects. This is a massive Memory Leak. So I clear this static List after everey scan intervall, but this crash also happens. So saving all peripheral objects in a static List will not fix this problem. We just need a bugfix not a workaround
So where did this land? Why there is not a fix already just adding the missing IntPtr constructor to Xamarin.IOS bindings? we are hitting the exactly same issue too.
Hi i have implemented the ICBPeripheralDelegate
explicitly on my own. It inherits NSObject
so that the IntPtr
Constructor is implemented. The Delegates
will be forwarded to my own Events
Steps to Reproduce
CBCentralManager
to discover Bluetooth Low Energy devices and register an event listener for theDiscoveredPeripheral
event.DiscoveredService
event) on the discoveredCBPeripheral
instance (reached into the listener using the event argsPeripheral
property).Expected Behavior
The event listener for the
DiscoveredService
event should be successfully registered.Actual Behavior
In some rare cases an exception is thrown:
The
_CBPeripheralDelegate
has indeed no constructor that takes one IntPtr argument.Environment
Observed on an iPhone 8 (A1905) running iOS 11.3.1
Build Logs
https://gist.github.com/MKuckert/274c50f61fe648b4d3368a9a7959a6d5
Example Project (If Possible)
Not possible