fix access violation during disposal of nested bodies