COMP: fix core dump due to premature object destruction