Add finalizer
fix compile error on vc.