mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* vm_method.c (rb_add_method_def): decrement alias count of
rb_method_definition_t to prevent memory leak. see [ruby-dev:41021]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ef3ea2dd89
commit
3728ec6ea3
2 changed files with 14 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
Wed Apr 21 00:01:05 2010 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* vm_method.c (rb_add_method_def): decrement alias count of
|
||||
rb_method_definition_t to prevent memory leak. see
|
||||
[ruby-dev:41021].
|
||||
|
||||
Tue Apr 20 21:33:06 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* ext/dl/win32/lib/win32/registry.rb (PredefinedKey#create): root key
|
||||
|
|
|
@ -215,6 +215,14 @@ rb_add_method_def(VALUE klass, ID mid, rb_method_type_t type, rb_method_definiti
|
|||
* another problem when the usage is changed.
|
||||
*/
|
||||
me = old_me;
|
||||
|
||||
if (me->def) {
|
||||
if (me->def->alias_count == 0)
|
||||
xfree(me->def);
|
||||
else if (me->def->alias_count > 0)
|
||||
me->def->alias_count--;
|
||||
me->def = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
me = ALLOC(rb_method_entry_t);
|
||||
|
|
Loading…
Reference in a new issue