Automatic destructor call insertion