Move this to line 195, so that the scoped_ptr can manage it ASAP.