Deprecate Val(BroFile*) ctor, replace with one using IntrusivePtr

This commit is contained in:
Jon Siwek 2020-05-15 17:11:05 -07:00
parent a031f5b727
commit 65aad4922d
9 changed files with 25 additions and 19 deletions

View file

@ -57,10 +57,13 @@ static const IntrusivePtr<FileType>& GetStringFileType() noexcept
return string_file_type;
}
Val::Val(BroFile* f)
: val(f), type(GetStringFileType())
Val::Val(BroFile* f) : Val({AdoptRef{}, f})
{}
Val::Val(IntrusivePtr<BroFile> f)
: val(f.release()), type(GetStringFileType())
{
assert(f->FType()->Tag() == TYPE_STRING);
assert(val.file_val->FType()->Tag() == TYPE_STRING);
}
Val::~Val()