Fixed t_context::f_terminate() is not called.
Changed to use std::unique_ptr<T>::reset().