src/bus/name.c
/**
 * name_ownership_release() - release name ownership
 * @ownership:          object to operate on
 * @change:             notification object
 *
 * This releases and destroys the name-ownership object @ownership. This is
 * meant as replacement for name_ownership_free(). Releasing name ownership
 * might require the caller to trigger notifications. Hence, rather than calling
 * name_ownership_free(), you must call its wrapper name_ownership_release(),
 * which then additionally returns required information to you.
 */
release name ownership
@ownership:          object to operate on
@change:             notification object

This releases and destroys the name-ownership object @ownership. This is
meant as replacement for name_ownership_free(). Releasing name ownership
might require the caller to trigger notifications. Hence, rather than calling
name_ownership_free(), you must call its wrapper name_ownership_release(),
which then additionally returns required information to you.
release name ownership @ownership : object to operate on @change : notification object This releases and destroys the name - ownership object @ownership . This is meant as replacement for name_ownership_free () . Releasing name ownership might require the caller to trigger notifications . Hence rather than calling name_ownership_free () you must call its wrapper name_ownership_release () which then additionally returns required information to you .
void name_ownership_release(NameOwnership *ownership, NameChange *change) {
        NameOwnership *primary;
        c_assert(!change->name);
        c_assert(!change->old_owner);
        c_assert(!change->new_owner);
        primary = name_primary(ownership->name);
        c_list_unlink(&ownership->name_link);
        if (ownership == primary) {
                primary = name_primary(ownership->name);
                change->name = name_ref(ownership->name);
                change->old_owner = ownership->owner;
                change->new_owner = primary ? primary->owner : NULL;
        }
        name_ownership_free(ownership);
}
void name_ownership_release ( NameOwnership * ownership , NameChange * change ) { NameOwnership * primary ; c_assert ( ! change -> name ) ; c_assert ( ! change -> old_owner ) ; c_assert ( ! change -> new_owner ) ; primary = name_primary ( ownership -> name ) ; c_list_unlink ( & ownership -> name_link ) ; if ( ownership == primary ) { primary = name_primary ( ownership -> name ) ; change -> name = name_ref ( ownership -> name ) ; change -> old_owner = ownership -> owner ; change -> new_owner = primary ? primary -> owner : NULL ; } name_ownership_free ( ownership ) ; }
name_ownership_release() - release name ownership
 @ownership:          object to operate on
 @change:             notification object
name_ownership_release () - release name ownership @ownership : object to operate on @change : notification object