Permalink
Browse files

fixed memory leak introduced by falcon-sparse-array patch

  • Loading branch information...
1 parent ddf2d77 commit 1f94ce6e54ef4efc7157888954b1e5b6b9283c29 @skaes committed Mar 14, 2013
@@ -0,0 +1,20 @@
+diff --git a/class.c b/class.c
+index 63fdd76..f5cb4a1 100644
+--- a/class.c
++++ b/class.c
+@@ -855,6 +855,7 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func
+ }
+ ary = rb_ary_new();
+ sa_foreach(&list, func, ary);
++ sa_clear(&list);
+
+ return ary;
+ }
+@@ -1089,6 +1090,7 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
+ }
+ ary = rb_ary_new();
+ sa_foreach(&list, ins_methods_i, ary);
++ sa_clear(&list);
+
+ return ary;
+ }
@@ -0,0 +1,20 @@
+diff --git a/class.c b/class.c
+index 63fdd76..f5cb4a1 100644
+--- a/class.c
++++ b/class.c
+@@ -855,6 +855,7 @@ class_instance_method_list(int argc, VALUE *argv, VALUE mod, int obj, int (*func
+ }
+ ary = rb_ary_new();
+ sa_foreach(&list, func, ary);
++ sa_clear(&list);
+
+ return ary;
+ }
+@@ -1089,6 +1090,7 @@ rb_obj_singleton_methods(int argc, VALUE *argv, VALUE obj)
+ }
+ ary = rb_ary_new();
+ sa_foreach(&list, ins_methods_i, ary);
++ sa_clear(&list);
+
+ return ary;
+ }

2 comments on commit 1f94ce6

@funny-falcon

@skaes , excuse me that I'm not pushes it for you. I was busy at work and didn't found time to do it.

@skaes
Owner
skaes commented on 1f94ce6 Mar 14, 2013

No problem.

But it would be great if you could create a real git repo for your patches, so it would be easier for other people to detect changes in your patches. Maybe similar in structure to what I have.

Please sign in to comment.