Skip to content

Commit

Permalink
Fixed segfaults in FindFileDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
danlucraft committed Feb 16, 2009
1 parent 52d5d55 commit 73c0e2e
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions plugins/project/dialogs/find_file_dialog.rb
Expand Up @@ -24,23 +24,27 @@ def initialize

def connect_signals
@entry.signal_connect("key-press-event") do |_, gdk_eventkey|
entry_key_press(gdk_eventkey)
entry_key_press(gdk_eventkey) unless @entry.destroyed?
false
end

@entry.signal_connect("changed") do
@entry_changed_time = Time.now
unless @entry_changed
@entry_changed = true
Gtk.idle_add_priority(GLib::PRIORITY_LOW) do
if Time.now > @entry_changed_time + 0.2
@entry_changed = false
entry_changed
false
else
true
unless @entry.destroyed?
@entry_changed_time = Time.now
unless @entry_changed
@entry_changed = true
Gtk.idle_add_priority(GLib::PRIORITY_LOW) do
if Time.now > @entry_changed_time + 0.2
@entry_changed = false
entry_changed
false
else
true
end
end
end
end
false
end
end

Expand All @@ -65,7 +69,6 @@ def entry_key_press(gdk_eventkey)

def entry_changed
@list.clear
puts "trying to access destroyed TextEntry from FindFileDialog#68" if @entry.destroyed?
if @entry.text.length > 0
fs = FindFileDialog.find_files(@entry.text, ProjectPlugin.tab.directories)
i = 0
Expand Down

0 comments on commit 73c0e2e

Please sign in to comment.