Forum: Ruby-Gnome 2 Adding new signals with latest CVS

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E63ceac0a4a9a299a984f4ccc86fc3a4?d=identicon&s=25 Geoff Youngs (Guest)
on 2006-04-20 14:55
(Received via mailing list)
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.
Ee6ffca720cc428d70247dcd7377dd48?d=identicon&s=25 Kouhei Sutou (Guest)
on 2006-04-20 14:59
(Received via mailing list)
Hi,

In <1145537268.16766.6.camel@ub5.islid.org>
  "[ruby-gnome2-devel-en] Adding new signals with latest CVS" on Thu, 20
Apr 2006 13:47:47 +0100,
  Geoff Youngs <g@intersect-uk.co.uk> 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...
This topic is locked and can not be replied to.