Skip to content
  • Tanu Kaskinen's avatar
    bluetooth: Move stuff to pa_bluetooth_transport_put/unlink() · 0df4d56c
    Tanu Kaskinen authored
    This should not have any effect on behaviour. The goal is to align
    with the pattern that I think we should follow:
    
    Object initialization:
     - put() is the place to create references from other objects to the
       newly created object. In this case, adding the transport to
       discovery->transports was moved from new() to put, and adding the
       transport to device->transports was moved from set_state() to
       put().
    
    Object destruction:
     - unlink() undoes put() and removes all references from other objects
       to the object being unlinked. In this case setting the
       device->transports pointer to NULL was moved from set_state() to
       unlink(), and setting the discovery->transports pointer to NULL was
       moved from free() to unlink().
     - free() undoes new(), but also calls unlink() so that object owners
       don't need to remember to call unlink() before free().
    0df4d56c