lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject lucy-clownfish git commit: Fix memory leaks
Date Fri, 27 Nov 2015 16:00:57 GMT
Repository: lucy-clownfish
Updated Branches:
  refs/heads/master 976199e97 -> 926947a14


Fix memory leaks


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

Branch: refs/heads/master
Commit: 926947a14696f218d95cd91973d8b6a49594b956
Parents: 976199e
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Fri Nov 27 17:00:30 2015 +0100
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Fri Nov 27 17:00:30 2015 +0100

----------------------------------------------------------------------
 compiler/src/CFCParamList.c      | 3 ++-
 compiler/src/CFCPerl.c           | 4 ++++
 compiler/src/CFCPerlMethod.c     | 1 +
 runtime/core/Clownfish/Class.cfh | 2 +-
 4 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/926947a1/compiler/src/CFCParamList.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCParamList.c b/compiler/src/CFCParamList.c
index 6c23f7f..0a5bed2 100644
--- a/compiler/src/CFCParamList.c
+++ b/compiler/src/CFCParamList.c
@@ -91,11 +91,12 @@ CFCParamList_add_param(CFCParamList *self, CFCVariable *variable,
 
 void
 CFCParamList_destroy(CFCParamList *self) {
-    CFCUtil_free_string_array(self->values);
     for (size_t i = 0; i < self->num_vars; i++) {
         CFCBase_decref((CFCBase*)self->variables[i]);
+        FREEMEM(self->values[i]);
     }
     FREEMEM(self->variables);
+    FREEMEM(self->values);
     FREEMEM(self->c_string);
     FREEMEM(self->name_list);
     CFCBase_destroy((CFCBase*)self);

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/926947a1/compiler/src/CFCPerl.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerl.c b/compiler/src/CFCPerl.c
index 0b9f7b8..f19af61 100644
--- a/compiler/src/CFCPerl.c
+++ b/compiler/src/CFCPerl.c
@@ -558,6 +558,8 @@ CFCPerl_write_bindings(CFCPerl *self) {
 
             // Add XSUB initialization at boot.
             xs_init = S_add_xs_init(xs_init, xsub);
+
+            CFCBase_decref((CFCBase*)constructors[j]);
         }
         FREEMEM(constructors);
 
@@ -574,6 +576,8 @@ CFCPerl_write_bindings(CFCPerl *self) {
 
             // Add XSUB initialization at boot.
             xs_init = S_add_xs_init(xs_init, xsub);
+
+            CFCBase_decref((CFCBase*)methods[j]);
         }
         FREEMEM(methods);
     }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/926947a1/compiler/src/CFCPerlMethod.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCPerlMethod.c b/compiler/src/CFCPerlMethod.c
index d549563..6c77e60 100644
--- a/compiler/src/CFCPerlMethod.c
+++ b/compiler/src/CFCPerlMethod.c
@@ -292,6 +292,7 @@ S_xsub_def_labeled_params(CFCPerlMethod *self, CFCClass *klass) {
     FREEMEM(arg_decls);
     FREEMEM(meth_type_c);
     FREEMEM(self_assign);
+    FREEMEM(arg_assigns);
     FREEMEM(body);
     FREEMEM(retval_decl);
     return xsub_def;

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/926947a1/runtime/core/Clownfish/Class.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Class.cfh b/runtime/core/Clownfish/Class.cfh
index 90a4ce1..704704d 100644
--- a/runtime/core/Clownfish/Class.cfh
+++ b/runtime/core/Clownfish/Class.cfh
@@ -130,7 +130,7 @@ public final class Clownfish::Class inherits Clownfish::Obj {
 
     /** Return novel methods of the class.
      */
-    Vector*
+    incremented Vector*
     Get_Methods(Class *self);
 
     public void


Mime
View raw message