# Gtk2 crash: bug or abuse?

**URL:** <https://www.ruby-forum.com/t/gtk2-crash-bug-or-abuse/180251>\
**Category:** Ruby\
**Created:** [December 15, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/gtk2-crash-bug-or-abuse/180251 "2009-12-15T21:46:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ohplease](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/cab0a1/32.png) [@ohplease](https://www.ruby-forum.com/u/ohplease)\
**Post date:** [December 15, 2009, 9:46pm UTC](https://www.ruby-forum.com/t/gtk2-crash-bug-or-abuse/180251/1 "2009-12-15T21:46:24Z")

</div>

Hi there.

I am running Ruby 1.8.7 (debian lenny/i386) and the following program  
crashes the ruby vm with a Segmentation Fault (when closing the window):

#!/usr/bin/env ruby  
=begin  
rubycalc - Ruby/GTK first sample script.  
=end

require ‘gtk2’

window = Gtk::Window.new  
window.signal\_connect(“delete\_event”) {  
puts “delete”  
false  
}

window.signal\_connect(“destroy”) {  
puts “destroy”  
Gtk.main\_quit  
}

window.add( $tos=Gtk::Entry.new() )  
style = Gtk::RcStyle.new  
font = Pango::FontDescription.new(“Sans Serif 15”)  
style.font\_desc = font  
$tos.modify\_style(style)

window.show\_all

Gtk.main

# EOF

Am I abusing RcStyle/Pango or did I discover a bug in the GTK2 bindings?

Regards  
Holger
