summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-26 06:39:13 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-26 06:39:13 +0000
commit9eee63661b39bb2832af4878922ac57674a2a4a7 (patch)
treec76de5b2e9deb3d80df5b37d3f246507ead64088
parentb513f647694a76714bde34d4cdc3990ce0dec7c3 (diff)
double free
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/curses/curses.c3
-rw-r--r--ext/curses/hello.rb4
-rw-r--r--ext/curses/view.rb1
3 files changed, 6 insertions, 2 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index c502d3faf61..89ed2966a02 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -423,7 +423,8 @@ window_close(obj)
struct windata *winp;
GetWINDOW(obj, winp);
- free_window(winp);
+ delwin(winp->window);
+ winp->window = 0;
return Qnil;
}
diff --git a/ext/curses/hello.rb b/ext/curses/hello.rb
index bed7779aac4..a1915ce60d0 100644
--- a/ext/curses/hello.rb
+++ b/ext/curses/hello.rb
@@ -10,6 +10,7 @@ def show_message(message)
win.box(?|, ?=)
win.setpos(2, 3)
win.addstr(message)
+ win.refresh
win.getch
win.close
end
@@ -18,8 +19,9 @@ init_screen
begin
crmode
# show_message("Hit any key")
- setpos (lines - 5) / 2, (cols - 10) / 2
+ setpos((lines - 5) / 2, (cols - 10) / 2)
addstr("Hit any key")
+ refresh
getch
show_message("Hello, World!")
refresh
diff --git a/ext/curses/view.rb b/ext/curses/view.rb
index e59a74ed448..5ba1a8413c4 100644
--- a/ext/curses/view.rb
+++ b/ext/curses/view.rb
@@ -43,6 +43,7 @@ while TRUE
addstr(data_lines[lptr + i]) #if data_lines[lptr + i]
i += 1
end
+ refresh
explicit = FALSE
n = 0