The list of bone collections of an edit bone wasn't freed when deleting that edit bone. Thanks @lichtwerk for the fix!