# Garbage collector and bigger projects

**URL:** <https://www.ruby-forum.com/t/garbage-collector-and-bigger-projects/81311>\
**Category:** Ruby-Gnome 2\
**Created:** [January 7, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/garbage-collector-and-bigger-projects/81311 "2007-01-07T15:03:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 7, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/garbage-collector-and-bigger-projects/81311/1 "2007-01-07T15:03:32Z")

</div>

Hi,

i have an other problem with the 0.16 version in an a little bit bigger  
project.

If the code grows at some point it seams that the garbage collector  
kills my callbacks (made with libglade). Then it gives me the following  
error message:

gladetest.rb:226: warning: GRClosure invoking callback: already  
destroyed

To get it again working it is enough to simply comment out some lines of  
the code.

Cheers  
detlef

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 7, 2007, 3:40pm UTC](https://www.ruby-forum.com/t/garbage-collector-and-bigger-projects/81311/2 "2007-01-07T15:40:35Z")

</div>

Am Sonntag, den 07.01.2007, 14:39 +0100 schrieb Detlef R.:

> Hi,

i think i found at least a part of the problem.

in

libglade/rbglade.c

on line 180 the objects get protected from the gc:

rb\_funcall(self, rb\_intern(“guard\_sources\_from\_gc”), 0);

But this call iterates over the complete widget tree and not from the  
selected xml-root.

Sorry, no solution from my side, cause i don’t know that much about the  
binding stuff.

Cheers  
detlef

> Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share your  
> opinions on IT & business topics through brief surveys - and earn cash  
> [http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
> 
> * * *
> 
> ruby-gnome2-devel-en mailing list  
> removed\_email\_address@domain.invalid  
> [ruby-gnome2-devel-en List Signup and Options](https://lists.sourceforge.net/lists/listinfo/ruby-gnome2-devel-en)

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 8, 2007, 2:17am UTC](https://www.ruby-forum.com/t/garbage-collector-and-bigger-projects/81311/3 "2007-01-08T02:17:34Z")

</div>

Hi,

In [1168177165.5874.10.camel@datengrab](mailto:1168177165.5874.10.camel@datengrab)  
“[ruby-gnome2-devel-en] Garbage collector and bigger projects” on Sun,  
07 Jan 2007 14:39:24 +0100,  
Detlef R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> i have an other problem with the 0.16 version in an a little bit bigger  
> project.
> 
> If the code grows at some point it seams that the garbage collector  
> kills my callbacks (made with libglade). Then it gives me the following  
> error message:
> 
> gladetest.rb:226: warning: GRClosure invoking callback: already  
> destroyed

Could you give us a sample script to reproduce the problem?

## Thanks,

kou

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
