tags 407515 +patch
thanks
Adapted, attached.
adaptation of
<http://librarian.launchpad.net/4946192/libglade2-rb-grclosure-fix.patch> to
the version of libglade in Etch.
--- libglade/lib/libglade2.rb.orig 2006-07-01 14:55:30.000000000 +0100
+++ libglade/lib/libglade2.rb 2007-01-27 13:08:51.000000000 +0000
@@ -39,6 +39,7 @@
end
if signal_proc
+ guard_source_from_gc(source)
case signal_proc.arity
when 0
sig_conn_proc.call(signal) {signal_proc.call}
@@ -92,6 +93,20 @@
[EMAIL PROTECTED], @custom_methods]
end
+ def guard_source_from_gc(source)
+ @sources ||= {}
+ @sources[source.object_id] = source
+ source.signal_connect("destroy") do |object|
+ @sources.delete(object.object_id)
+ end
+ # To get the parent window of the source as a ruby object.
+ # Ruby/GTK keeps the Window objects on the memory to prevend from GC.
+ parent = source.parent
+ while parent
+ parent = parent.parent
+ end
+ end
+
LOG_DOMAIN = "libglade"
end