Skip to content

Commit

Permalink
Add a rescue block in the main event loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
danlucraft committed Mar 31, 2012
1 parent 06a2d0f commit 93ecf93
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions lib/swt/event_loop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ def start
@running = true
@display = Swt.display
while @running and not @display.disposed?
unless read = @display.read_and_dispatch
@display.sleep
begin
unless read = @display.read_and_dispatch
@display.sleep
end
rescue java.lang.Throwable => e
puts "Error in Event Loop:"
p e
puts e.backtrace
end
end
@display.dispose
Expand Down
2 changes: 1 addition & 1 deletion lib/swt/minimal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'swt/cucumber_runner'

module Swt
VERSION = "0.12" # also change in swt.gemspec
VERSION = "0.13" # also change in swt.gemspec

import org.eclipse.swt.SWT

Expand Down
2 changes: 1 addition & 1 deletion swt.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Gem::Specification.new do |s|
s.name = "swt"
s.version = "0.12" # also change in lib/swt/minimal.rb
s.version = "0.13" # also change in lib/swt/minimal.rb
s.platform = "ruby"
s.authors = ["Daniel Lucraft"]
s.email = ["dan@fluentradical.com"]
Expand Down

0 comments on commit 93ecf93

Please sign in to comment.