fix memory leaks in SHVC