From: Joachim G. <rub...@an...> - 2008-03-01 22:17:48
|
Hi, This one is driving me crazy. I'm using ruby-gnome2 0.16.0 on an 32-bit linux machine. I've something like this class TestTable attr_accessor :content_types attr_accessor :content_columns attr_accessor :view attr_accessor :liststore def initialize self.content_types = String, Integer, String, STring, String self.content_columns = ["hmm","int","a","b","c"] self.liststore = Gtk::ListStore.new(*self.content_types) self.view = Gtk::TreeView.new(self.liststore) self.liststore.signal_connect("sort-column-changed"){ |me| c_id, order = self.liststore.sort_column_id puts "sort column changed: #{c_id} #{order}" } end end The signal_connect("sort-column-changed") parts causes the headache. For the first times it works, then I'll get the warning ./start.rb:19: warning: GRClosure invoking callback: already destroyed (line 19 in start.rb is Gtk.main ) I tracked down the problem to the Garbage collector. A GC.disable solves this issue.. but then my program dosen't free memory anymore which is not a good thing at all. liststore is still there and liststore.sort_column_id is also updated. So I guess the signal-connect block has been deleted by the GC? I wanted to create a test-case. But strangely I cannot reproduce this error in my test application which only removed my API part and simplified some things. Any advise how to debug this? -- Posted via http://www.ruby-forum.com/. |