Fix another function val reference counting bug.

Now that functions get unref'd in the val dtor in order to free mem of
unserialized functions, it's important to ref a function when creating a
val from a pre-existing function so it's not prematurely free'd.
This commit is contained in:
Jon Siwek 2013-09-13 12:51:24 -05:00
parent bcf79fe11a
commit 33a7e96268

View file

@ -30,6 +30,7 @@
Val::Val(Func* f) Val::Val(Func* f)
{ {
val.func_val = f; val.func_val = f;
::Ref(val.func_val);
type = f->FType()->Ref(); type = f->FType()->Ref();
attribs = 0; attribs = 0;
#ifdef DEBUG #ifdef DEBUG