# Adding new signals with latest CVS

**URL:** <https://www.ruby-forum.com/t/adding-new-signals-with-latest-cvs/58313>\
**Category:** Ruby-Gnome 2\
**Created:** [April 20, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/adding-new-signals-with-latest-cvs/58313 "2006-04-20T14:55:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoff\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ac91a4/32.png) [@Geoff\_Y](https://www.ruby-forum.com/u/Geoff_Y)\
**Post date:** [April 20, 2006, 2:55pm UTC](https://www.ruby-forum.com/t/adding-new-signals-with-latest-cvs/58313/1 "2006-04-20T14:55:56Z")

</div>

Hi,

The latest CVS version of Ruby-GNOME2 is throwing exceptions when  
registering new signals.

e.g.  
—8\<—  
require ‘glib2’

class Foo \< GLib::Object  
type\_register

signal\_new(“bar”,  
GLib::Signal::RUN\_FIRST,  
nil,  
GLib::Type[“void”])

def do\_bar  
end  
end  
—8\<—

I think the problem is the in revision 1.52 of  
ruby-gnome2/ruby-gnome2/glib/src/rbgobj\_signal.c  
and revision 1.26 of  
ruby-gnome2/ruby-gnome2/glib/src/rbgobj\_closure.c

New function ‘g\_rclosure\_attach’ expects to be given a instance of a  
GObject (ie. T\_DATA) but for a new signal the class, rather than an  
instance, is passed instead (ie. T\_CLASS).

AFAICS, the purpose of the changes is to make it possible to do garbage  
collection of proc objects. As classes never die (and so the closure  
won’t be ), what I’ve tried to do is disable the code which reduces the  
reference count on a GRClosure unless the object is of type T\_DATA: it  
would never be called, because the class will never be GC’d.

If someone who understands the internals of the glib bindings better  
than I do could review the attached patch, that would be great.

Thanks,

Geoff.

---

<div class="post-metadata">

**Author:** ![Geoff\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ac91a4/32.png) [@Geoff\_Y](https://www.ruby-forum.com/u/Geoff_Y)\
**Post date:** [April 20, 2006, 2:59pm UTC](https://www.ruby-forum.com/t/adding-new-signals-with-latest-cvs/58313/2 "2006-04-20T14:59:01Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Adding new signals with latest CVS” on Thu, 20  
Apr 2006 13:47:47 +0100,  
Geoff Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> The latest CVS version of Ruby-GNOME2 is throwing exceptions when  
> registering new signals.

Oh…  
I have fixed the problem today in CVS.

## Thanks,

kou

* * *

Using Tomcat but need to do more? Need to support web services,  
security?  
Get stuff done quickly with pre-integrated technology to make your job  
easier  
Download IBM WebSphere Application Server v.1.0.1 based on Apache  
Geronimo  
[http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642](http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642)
