Updated Branches: refs/heads/cfc-tests 6ff8c609a -> b2f38681e
Fix memory leaks in CFC Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/b2f38681 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/b2f38681 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/b2f38681 Branch: refs/heads/cfc-tests Commit: b2f38681e7a77317bd3cc9cd709bbadf46b628db Parents: 6d02348 Author: Nick Wellnhofer <[email protected]> Authored: Sun Feb 3 20:59:21 2013 +0100 Committer: Nick Wellnhofer <[email protected]> Committed: Sun Feb 3 20:59:21 2013 +0100 ---------------------------------------------------------------------- clownfish/compiler/src/CFCClass.c | 1 + clownfish/compiler/src/CFCDumpable.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/b2f38681/clownfish/compiler/src/CFCClass.c ---------------------------------------------------------------------- diff --git a/clownfish/compiler/src/CFCClass.c b/clownfish/compiler/src/CFCClass.c index 09ffa68..d3287dd 100644 --- a/clownfish/compiler/src/CFCClass.c +++ b/clownfish/compiler/src/CFCClass.c @@ -219,6 +219,7 @@ CFCClass_destroy(CFCClass *self) { FREEMEM(attribute->value); FREEMEM(attribute); } + CFCBase_decref((CFCBase*)self->file_spec); FREEMEM(self->children); FREEMEM(self->functions); FREEMEM(self->methods); http://git-wip-us.apache.org/repos/asf/lucy/blob/b2f38681/clownfish/compiler/src/CFCDumpable.c ---------------------------------------------------------------------- diff --git a/clownfish/compiler/src/CFCDumpable.c b/clownfish/compiler/src/CFCDumpable.c index 14d6204..1853203 100644 --- a/clownfish/compiler/src/CFCDumpable.c +++ b/clownfish/compiler/src/CFCDumpable.c @@ -165,10 +165,10 @@ S_add_dump_method(CFCClass *klass) { const size_t BUF_SIZE = 400; char buf[BUF_SIZE]; - char *full_typedef = CFCMethod_full_typedef(method, klass); - char *full_meth = CFCMethod_full_method_sym(method, klass); - if (parent && CFCClass_has_attribute(parent, "dumpable")) { + char *full_typedef = CFCMethod_full_typedef(method, klass); + char *full_meth = CFCMethod_full_method_sym(method, klass); + const char pattern[] = "cfish_Obj*\n" "%s(%s *self)\n" @@ -221,10 +221,10 @@ S_add_load_method(CFCClass *klass) { const size_t BUF_SIZE = 400; char buf[BUF_SIZE]; - char *full_typedef = CFCMethod_full_typedef(method, klass); - char *full_meth = CFCMethod_full_method_sym(method, klass); - if (parent && CFCClass_has_attribute(parent, "dumpable")) { + char *full_typedef = CFCMethod_full_typedef(method, klass); + char *full_meth = CFCMethod_full_method_sym(method, klass); + const char pattern[] = "cfish_Obj*\n" "%s(%s *self, cfish_Obj *dump)\n"
