mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/tk/tcltklib.c: SEGV when exit.
* ext/tk/lib/tk.rb: add a check for safety to Tk.exit. * ext/tk/sample/irbtkw.rbw: freezes when receives SIGINT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1723931102
commit
5ebf704953
4 changed files with 31 additions and 9 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Tue Jun 17 01:52:50 2008 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||||
|
|
||||||
|
* ext/tk/tcltklib.c: SEGV when exit.
|
||||||
|
|
||||||
|
* ext/tk/lib/tk.rb: add a check for safety to Tk.exit.
|
||||||
|
|
||||||
|
* ext/tk/sample/irbtkw.rbw: freezes when receives SIGINT.
|
||||||
|
|
||||||
Mon Jun 16 21:58:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Mon Jun 16 21:58:38 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/stringio/stringio.c (strio_each, strio_readlines): IO#each and
|
* ext/stringio/stringio.c (strio_each, strio_readlines): IO#each and
|
||||||
|
|
|
@ -1110,7 +1110,7 @@ module TkCore
|
||||||
extend TkComm
|
extend TkComm
|
||||||
|
|
||||||
WITH_RUBY_VM = Object.const_defined?(:VM) && ::VM.class == Class
|
WITH_RUBY_VM = Object.const_defined?(:VM) && ::VM.class == Class
|
||||||
WITH_ENCODING = defined?(::Encoding.default_external)
|
WITH_ENCODING = defined?(::Encoding.default_external) && true
|
||||||
#WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class
|
#WITH_ENCODING = Object.const_defined?(:Encoding) && ::Encoding.class == Class
|
||||||
|
|
||||||
unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
|
unless self.const_defined? :RUN_EVENTLOOP_ON_MAIN_THREAD
|
||||||
|
@ -2174,7 +2174,7 @@ module Tk
|
||||||
end
|
end
|
||||||
|
|
||||||
def Tk.exit
|
def Tk.exit
|
||||||
tk_call_without_enc('destroy', '.')
|
TkCore::INTERP.has_mainwindow? && tk_call_without_enc('destroy', '.')
|
||||||
end
|
end
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
|
@ -5501,7 +5501,7 @@ TkWidget = TkWindow
|
||||||
#Tk.freeze
|
#Tk.freeze
|
||||||
|
|
||||||
module Tk
|
module Tk
|
||||||
RELEASE_DATE = '2008-06-11'.freeze
|
RELEASE_DATE = '2008-06-17'.freeze
|
||||||
|
|
||||||
autoload :AUTO_PATH, 'tk/variable'
|
autoload :AUTO_PATH, 'tk/variable'
|
||||||
autoload :TCL_PACKAGE_PATH, 'tk/variable'
|
autoload :TCL_PACKAGE_PATH, 'tk/variable'
|
||||||
|
|
|
@ -48,10 +48,20 @@ console.yscrollbar(TkScrollbar.new(top, :width=>10).pack(:before=>console,
|
||||||
:side=>:right,
|
:side=>:right,
|
||||||
:expand=>false,
|
:expand=>false,
|
||||||
:fill=>:y))
|
:fill=>:y))
|
||||||
|
|
||||||
|
# save original I/O
|
||||||
|
out = $stdout
|
||||||
|
err = $stderr
|
||||||
|
|
||||||
irb_thread = nil
|
irb_thread = nil
|
||||||
ev_loop = Thread.new{
|
ev_loop = Thread.new{
|
||||||
|
begin
|
||||||
Tk.mainloop
|
Tk.mainloop
|
||||||
|
ensure
|
||||||
|
$stdout = out
|
||||||
|
$stderr = err
|
||||||
irb_thread.kill if irb_thread
|
irb_thread.kill if irb_thread
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
# window position control
|
# window position control
|
||||||
|
@ -142,5 +152,5 @@ console.bind('Control-c'){
|
||||||
irb_thread.join
|
irb_thread.join
|
||||||
|
|
||||||
# exit
|
# exit
|
||||||
ev_thread.kill
|
ev_loop.kill
|
||||||
Tk.exit
|
Tk.exit
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
* Oct. 24, 1997 Y. Matsumoto
|
* Oct. 24, 1997 Y. Matsumoto
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define TCLTKLIB_RELEASE_DATE "2008-06-12"
|
#define TCLTKLIB_RELEASE_DATE "2008-06-17"
|
||||||
|
|
||||||
#include "ruby.h"
|
#include "ruby.h"
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ static int have_rb_thread_waiting_for_value = 0;
|
||||||
#ifdef RUBY_USE_NATIVE_THREAD
|
#ifdef RUBY_USE_NATIVE_THREAD
|
||||||
#define DEFAULT_EVENT_LOOP_MAX 800/*counts*/
|
#define DEFAULT_EVENT_LOOP_MAX 800/*counts*/
|
||||||
#define DEFAULT_NO_EVENT_TICK 10/*counts*/
|
#define DEFAULT_NO_EVENT_TICK 10/*counts*/
|
||||||
#define DEFAULT_NO_EVENT_WAIT 10/*milliseconds ( 1 -- 999 ) */
|
#define DEFAULT_NO_EVENT_WAIT 1/*milliseconds ( 1 -- 999 ) */
|
||||||
#define WATCHDOG_INTERVAL 10/*milliseconds ( 1 -- 999 ) */
|
#define WATCHDOG_INTERVAL 10/*milliseconds ( 1 -- 999 ) */
|
||||||
#define DEFAULT_TIMER_TICK 0/*milliseconds ( 0 -- 999 ) */
|
#define DEFAULT_TIMER_TICK 0/*milliseconds ( 0 -- 999 ) */
|
||||||
#define NO_THREAD_INTERRUPT_TIME 100/*milliseconds ( 1 -- 999 ) */
|
#define NO_THREAD_INTERRUPT_TIME 100/*milliseconds ( 1 -- 999 ) */
|
||||||
|
@ -1555,6 +1555,10 @@ eventloop_sleep(dummy)
|
||||||
{
|
{
|
||||||
struct timeval t;
|
struct timeval t;
|
||||||
|
|
||||||
|
if (no_event_wait <= 0) {
|
||||||
|
return Qnil;
|
||||||
|
}
|
||||||
|
|
||||||
t.tv_sec = (time_t)0;
|
t.tv_sec = (time_t)0;
|
||||||
t.tv_usec = (time_t)(no_event_wait*1000.0);
|
t.tv_usec = (time_t)(no_event_wait*1000.0);
|
||||||
|
|
||||||
|
@ -5096,7 +5100,7 @@ ip_finalize(ip)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* delete root widget */
|
/* delete root widget */
|
||||||
#if 1
|
#if 0 /* cause SEGV on Ruby 1.9 */
|
||||||
DUMP1("check `destroy'");
|
DUMP1("check `destroy'");
|
||||||
if (Tcl_GetCommandInfo(ip, "destroy", &info)) {
|
if (Tcl_GetCommandInfo(ip, "destroy", &info)) {
|
||||||
DUMP1("call `destroy .'");
|
DUMP1("call `destroy .'");
|
||||||
|
|
Loading…
Reference in a new issue