summaryrefslogtreecommitdiff
path: root/ext/tk/lib/tkafter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tk/lib/tkafter.rb')
-rw-r--r--ext/tk/lib/tkafter.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/tk/lib/tkafter.rb b/ext/tk/lib/tkafter.rb
index eddfc16f63..529b1e6cfb 100644
--- a/ext/tk/lib/tkafter.rb
+++ b/ext/tk/lib/tkafter.rb
@@ -114,7 +114,14 @@ class TkTimer
@id = Tk_CBID.join
Tk_CBID[1].succ!
- @cb_cmd = TkCore::INTERP.get_cb_entry(self.method(:do_callback))
+ # @cb_cmd = TkCore::INTERP.get_cb_entry(self.method(:do_callback))
+ @cb_cmd = TkCore::INTERP.get_cb_entry(proc{
+ begin
+ self.do_callback
+ rescue
+ self.cancel
+ end
+ })
@set_next = true