OSDN Git Service
adapter: Call driver remove callback when unregistering driver
This seems to be what plugins expect as only dbusoob explicite called
its remove function before unregistering adapter drivers.
This results in cleaner shutdown path:
Without patch:
bluetoothd[13563]: src/mgmt.c:mgmt_remove_uuid() index 0
bluetoothd[13563]: src/adapter.c:btd_adapter_unref() 0x606b2a0: ref=4
bluetoothd[13563]: src/adapter.c:btd_adapter_unref() 0x606b2a0: ref=3
bluetoothd[13563]: Stopping SDP server
bluetoothd[13563]: Exit
==13563==
==13563== HEAP SUMMARY:
==13563== in use at exit: 64,908 bytes in 395 blocks
==13563== total heap usage: 7,035 allocs, 6,640 frees, 4,432,371 bytes allocated
==13563==
==13563== LEAK SUMMARY:
==13563== definitely lost: 0 bytes in 0 blocks
==13563== indirectly lost: 0 bytes in 0 blocks
==13563== possibly lost: 17,429 bytes in 169 blocks
==13563== still reachable: 47,479 bytes in 226 blocks
==13563== suppressed: 0 bytes in 0 blocks
With patch:
bluetoothd[13301]: src/mgmt.c:mgmt_remove_uuid() index 0
bluetoothd[13301]: src/adapter.c:btd_adapter_unref() 0x606b2a0: ref=1
bluetoothd[13301]: src/adapter.c:btd_adapter_unref() 0x606b2a0: ref=0
bluetoothd[13301]: src/adapter.c:adapter_free() 0x606b2a0
bluetoothd[13301]: Stopping SDP server
bluetoothd[13301]: Exit
==13301==
==13301== HEAP SUMMARY:
==13301== in use at exit: 64,954 bytes in 348 blocks
==13301== total heap usage: 7,247 allocs, 6,899 frees, 4,625,672 bytes allocated
==13301==
==13301== LEAK SUMMARY:
==13301== definitely lost: 0 bytes in 0 blocks
==13301== indirectly lost: 0 bytes in 0 blocks
==13301== possibly lost: 17,334 bytes in 150 blocks
==13301== still reachable: 47,620 bytes in 198 blocks
==13301== suppressed: 0 bytes in 0 blocks