Attempted fix of resource leak in qt-ble.c

Berthold Stoeger bstoeger at mail.tuwien.ac.at
Tue Oct 24 12:35:24 PDT 2017


Dear all,

in a previous email I reported leaking resources in qt-ble.c. Here is my 
attempt at a fix. I reckon this ideally has no user-visible effect (i.e. is 
gratuitous), yet is risky. Therefore some prudence is in order.

There are three patches with a decreasing degree of obviousness.

1) Delete created Service objects in destructor of BLEObject.
2) Let BLEObject take ownership of the Connection object so that the latter 
can be deleted in the destructor of the former. Delete BLEObject in error 
cases.
3) Optional: Move creation of the Connection object to the BLEObject to avoid 
ownership subtleties.

Berthold 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-resource-leak-in-qt-ble.cpp.patch
Type: text/x-patch
Size: 842 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171024/1f430405/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-resource-leak-in-qt-ble.cpp.patch
Type: text/x-patch
Size: 2570 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171024/1f430405/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Move-creation-of-BLE-controller-into-BLEObject.patch
Type: text/x-patch
Size: 7909 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20171024/1f430405/attachment-0002.bin>


More information about the subsurface mailing list