# What is the current status?

**URL:** <https://www.ruby-forum.com/t/what-is-the-current-status/77675>\
**Category:** Ruby-Gnome 2\
**Created:** [November 29, 2006, 5:27pm UTC](https://www.ruby-forum.com/t/what-is-the-current-status/77675 "2006-11-29T17:27:48Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![williej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@williej](https://www.ruby-forum.com/u/williej)\
**Post date:** [December 6, 2006, 2:51pm UTC](https://www.ruby-forum.com/t/what-is-the-current-status/77675/21 "2006-12-06T14:51:35Z")

</div>

> > Please check again my explanation: rclosure\_unref is _not_ called in  
> > step #1 or #2.
> 
> Both #1 and #2 calls rclosure\_invalidate() but don’t call  
> rclosure\_unref(). Is it OK?

That’s right.

> when the first rclosure\_invalidate() call?  
> Yes. Remember that in #1, this is the Ruby’s GC who’s firing, hence it  
> calls your callback gr\_closure\_holder\_free which sets the holder to  
> Qnil before invoking rclosure\_invalidate.

> > I explained it in the last paragraph of my previous message, but I can  
> > show it as code if you prefer:
> 
> Thanks. I’m good in programming language rather than  
> English. X\<

That’s maybe the best common language we have, that’s right 🙂

> > ```
> > }
> > 
> > ```
> 
> rcosure isn’t freed but rclosure-\>rb\_holder is freed. Is it  
> OK? If it’s true, does the following patch solve your

That’s correct.

> ```
> GRClosureHolder *holder;
> Data_Get_Struct(rclosure->rb_holder, GRClosureHolder, holder);
> holder->closure = NULL;
> 
> ```
> 
> - 
> 
> ```
> rclosure->rb_holder = Qnil;
> 
> ```

No. Remember, rclosure\_unref is unfortunately never called in the  
described scenario.

Btw, the point of my suggested patch is exactly to be able to call  
rclosure\_unref (with a count of 1) in case rclosure\_invalidate is  
triggered. Remember, when GTK calls rclosure\_invalidate, it means the  
memory for the closure will be freed right after that, so in my  
opinion the flaw is in your rclosure\_invalidate, which should always  
take necessary actions so that no code would lookup again data in the  
closure after that, so calling the series of weak\_unref is crucial.  
That’s the spirit of my patch.

–  
Guillaume C. - [Guillaume Cottenceau](http://zarb.org/~gc/)

* * *

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:** ![williej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@williej](https://www.ruby-forum.com/u/williej)\
**Post date:** [December 10, 2006, 2:25pm UTC](https://www.ruby-forum.com/t/what-is-the-current-status/77675/22 "2006-12-10T14:25:08Z")

</div>

> I’ve committed your patch.

Thanks. I can now confirm that using latest CVS, my application booh  
has zero crashes, and valgrind also reports zero memory allocation  
problems. That is good news! Thanks for your hard work.

–  
Guillaume C. - [Guillaume Cottenceau](http://zarb.org/~gc/)

* * *

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:** ![williej](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/90ced4/32.png) [@williej](https://www.ruby-forum.com/u/williej)\
**Post date:** [December 7, 2006, 3:53pm UTC](https://www.ruby-forum.com/t/what-is-the-current-status/77675/23 "2006-12-07T15:53:04Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] What is the current status?” on Wed, 6 Dec  
2006 14:47:35 +0100,  
“Guillaume C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > rclosure->count = 1;
> > rclosure_unref(rclosure);
> > }
> > 
> > ```
> > 
> > Ah. Does what you said mean that rcosure is already dead  
> > when the first rclosure\_invalidate() call?
> 
> Yes. Remember that in #1, this is the Ruby’s GC who’s firing, hence it  
> calls your callback gr\_closure\_holder\_free which sets the holder to  
> Qnil before invoking rclosure\_invalidate.

Ah. OK. I understood.

> > > ```
> > > }
> > > 
> > > ```

I’ve committed your patch.

## 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)

[Previous page](https://www.ruby-forum.com/t/what-is-the-current-status/77675.md?page=1)
