Skip to content

Commit 2eaabbd

Browse files
cortlandstarrettleviathan747
authored andcommitted
delete link when done
After disconnecting instances from links, delete the link. This was discovered by running a pyxtuml model which did many creates and relates and then unrelates and deletes.
1 parent 52d4e4d commit 2eaabbd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xtuml/meta.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,8 @@ def disconnect(self, instance, another_instance):
335335
return False
336336

337337
self[instance].remove(another_instance)
338+
if len(self[instance]) == 0:
339+
del self[instance]
338340
return True
339341

340342
def navigate(self, instance):

0 commit comments

Comments
 (0)