changed dtor order in resoure_manager