From 33a7e96268fc46b9b49d578070392b369b43537d Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Fri, 13 Sep 2013 12:51:24 -0500 Subject: [PATCH] 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. --- src/Val.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Val.cc b/src/Val.cc index 3e5b0eff48..389e76fe1d 100644 --- a/src/Val.cc +++ b/src/Val.cc @@ -30,6 +30,7 @@ Val::Val(Func* f) { val.func_val = f; + ::Ref(val.func_val); type = f->FType()->Ref(); attribs = 0; #ifdef DEBUG