Remove memory leak in MultiBodyGraph.