bleak icon indicating copy to clipboard operation
bleak copied to clipboard

leaking an uninitialized object of type CBCentralManager

Open paorin opened this issue 11 months ago • 1 comments

Mac OS 10.11 Python 3.11 bleak 0.22.3 pyobjc 10.3.2

When calling

await BleakScanner.discover(5.0, return_adv=True)

I get the following error

/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/bleak/backends/corebluetooth/CentralManagerDelegate.py:76: UninitializedDeallocWarning: leaking an uninitialized object of type CBCentralManager
  self.central_manager = CBCentralManager.alloc().initWithDelegate_queue_(
Traceback (most recent call last):

[...]

  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/bleak/backends/corebluetooth/CentralManagerDelegate.py", line 76, in init
    self.central_manager = CBCentralManager.alloc().initWithDelegate_queue_(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: depythonifying 'pointer', got 'OS_dispatch_queue'

paorin avatar Jan 22 '25 21:01 paorin

Mac OS 10.11

Hmm... this could be the issue. I'm not able to test Bleak on older versions of macOS.

Looks like similar reports here: https://github.com/ronaldoussoren/pyobjc/issues/220

dlech avatar Jan 23 '25 00:01 dlech