Make sure to clone a Class's methods
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fd30d706 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fd30d706 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fd30d706 Branch: refs/heads/clone_class_registry Commit: fd30d706d5e06019c36c744d3023954d73614f75 Parents: 8598709 Author: Nick Wellnhofer <[email protected]> Authored: Sun Aug 3 14:32:07 2014 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Sun Aug 3 17:38:04 2014 +0200 ---------------------------------------------------------------------- runtime/core/Clownfish/Class.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fd30d706/runtime/core/Clownfish/Class.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/Class.c b/runtime/core/Clownfish/Class.c index 6a3ce9d..a60aca9 100644 --- a/runtime/core/Clownfish/Class.c +++ b/runtime/core/Clownfish/Class.c @@ -180,7 +180,8 @@ Class_Clone_IMP(Class *self) { memcpy(twin, self, self->class_alloc_size); Class_Init_Obj(self->klass, twin); // Set refcount. - twin->name = Str_Clone(self->name); + twin->name = Str_Clone(self->name); + twin->methods = VA_Clone(self->methods); return twin; }
