Add a missing incref.

This fixes a potential segfault at teardown, when the class registry is
being emptied.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/87b63a8c
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/87b63a8c
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/87b63a8c

Branch: refs/heads/go_bindings_2
Commit: 87b63a8cc8acb015834469b18d4956bca396eebf
Parents: 93ce926
Author: Marvin Humphrey <[email protected]>
Authored: Tue Nov 11 15:08:42 2014 -0800
Committer: Marvin Humphrey <[email protected]>
Committed: Sat Nov 29 14:07:54 2014 -0800

----------------------------------------------------------------------
 compiler/src/CFCMethod.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/87b63a8c/compiler/src/CFCMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCMethod.c b/compiler/src/CFCMethod.c
index 2a1bba1..ee5cb29 100644
--- a/compiler/src/CFCMethod.c
+++ b/compiler/src/CFCMethod.c
@@ -255,7 +255,8 @@ CFCMethod_finalize(CFCMethod *self) {
                         self->function.param_list,
                         self->function.docucomment, true,
                         self->is_abstract);
-    finalized->novel_method = self->novel_method;
+    finalized->novel_method
+        = (CFCMethod*)CFCBase_incref((CFCBase*)self->novel_method);
     finalized->is_novel     = self->is_novel;
     return finalized;
 }

Reply via email to