From: SourceForge.net <no...@so...> - 2005-10-29 13:21:13
|
Bugs item #1341573, was opened at 2005-10-29 15:21 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=470969&aid=1341573&group_id=53614 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Tobias Herzke (t-peters) Assigned to: Nobody/Anonymous (nobody) Summary: Memory leak in gdk pixbuf Initial Comment: #!/usr/bin/env ruby # This is an example ruby program that demonstrates a bug in the gdk # pixbuf wrapper. # Set the IMAGE_FILE constant below to point to some image file on # your system. Then click repeatedly on the Reload button and watch # the memory used by the ruby process getting larger with each click. If # you have the patience, it will eat up all your memory and swap # space. (Caution: Linux may kill unrelated processes when it runs out # of memory) # # Explicitly invoking the garbage collector does not solve the problem. # # Versions: ruby-gnome2 0.14.0, gtk 2.6.4 # # Workaround: Use Gdk::Pixbuf::new with 4 arguments (uses # gdk_pixbuf_new_from_file_at_scale, but does not allow to specify # interpolation strategy) # Set this to some image file name on your system IMAGE_FILE = "img.jpg" require "gtk2" Gtk.init window = Gtk::Window.new hbox = Gtk::HBox.new button = Gtk::Button.new("Reload") img_area = Gtk::Image.new hbox.add(button) hbox.add(img_area) window.add(hbox) window.show_all button.signal_connect(:clicked) { pixbuf = Gdk::Pixbuf.new("img.jpg") img_area.set(pixbuf.scale(740,740,Gdk::Pixbuf::INTERP_BILINEAR)) # GC.start # introducing GC calls does NOT solve the problem } window.signal_connect(:delete_event) {Gtk.main_quit} Gtk.main ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=470969&aid=1341573&group_id=53614 |