I applied a patch to fix all the list *_free functions

I applied a patch to fix all the list *_free functions.

These functions were horribly broken. Not only could they fail to
release the memory if an error occurred, they never actually freed the
memory even if everything succeeded! The argument variable was
reused, so when, for example, g_list_free was actually called, the
argument would be NULL.

Hi,

In [email protected]
“[ruby-gnome2-devel-en] I applied a patch to fix all the list *_free
functions” on Fri, 23 Jul 2010 18:55:03 +0200,
Nikolai W. [email protected] wrote:

I applied a patch to fix all the list *_free functions.

These functions were horribly broken. Not only could they fail to
release the memory if an error occurred, they never actually freed the
memory even if everything succeeded! The argument variable was
reused, so when, for example, g_list_free was actually called, the
argument would be NULL.

It seems that rbgutil_glist2ary_string_and_free() doesn’t
free list data when it gets an error while processing.

e.g.:

list: (“a”, “b”, “c”)
error on “b”:
* “c” will not be freed. (“b” may not be freed?)
* list will be freed.

Thanks,

kou

On Sat, Jul 24, 2010 at 01:39, Kouhei S. [email protected] wrote:

 Nikolai W. [email protected] wrote:

These functions were horribly broken. Â Not only could they fail to
release the memory if an error occurred, they never actually freed the
memory even if everything succeeded! Â The argument variable was
reused, so when, for example, g_list_free was actually called, the
argument would be NULL.

It seems that rbgutil_glist2ary_string_and_free() doesn’t
free list data when it gets an error while processing.

You’re correct. I’ve committed a fix. Thanks!

Hi,

In [email protected]
“Re: [ruby-gnome2-devel-en] I applied a patch to fix all the list
*_free functions” on Sat, 24 Jul 2010 10:39:55 +0200,
Nikolai W. [email protected] wrote:

It seems that rbgutil_glist2ary_string_and_free() doesn’t
free list data when it gets an error while processing.

You¢re correct. I¢ve committed a fix. Thanks!

Thanks!

kou

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs