mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-02-25 21:29:54 +07:00
unit: free data from merged unit when we don't need it anymore
This commit is contained in:
parent
819e213fbf
commit
3616a49cb0
9
unit.c
9
unit.c
@ -424,11 +424,16 @@ int unit_merge(Unit *u, Unit *other) {
|
|||||||
for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++)
|
for (d = 0; d < _UNIT_DEPENDENCY_MAX; d++)
|
||||||
merge_dependencies(u, other, d);
|
merge_dependencies(u, other, d);
|
||||||
|
|
||||||
unit_add_to_dbus_queue(u);
|
|
||||||
|
|
||||||
other->meta.load_state = UNIT_MERGED;
|
other->meta.load_state = UNIT_MERGED;
|
||||||
other->meta.merged_into = u;
|
other->meta.merged_into = u;
|
||||||
|
|
||||||
|
/* If there is still some data attached to the other node, we
|
||||||
|
* don't need it anymore, and can free it. */
|
||||||
|
if (other->meta.load_state != UNIT_STUB)
|
||||||
|
if (UNIT_VTABLE(other)->done)
|
||||||
|
UNIT_VTABLE(other)->done(other);
|
||||||
|
|
||||||
|
unit_add_to_dbus_queue(u);
|
||||||
unit_add_to_cleanup_queue(other);
|
unit_add_to_cleanup_queue(other);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user