author | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月08日 00:47:16 +0200 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2010年08月08日 00:47:16 +0200 |
commit | edd594b48a302145178679af1719d1a85454dee4 (patch) | |
tree | 325bc8f04f91b81c4cf10fb2731a5cddc8dd74a9 /agg-plot/canvas-window.cpp | |
parent | 7ca6cb456b8517b97c9a063f07799b3babda3b5e (diff) | |
download | gsl-shell-edd594b48a302145178679af1719d1a85454dee4.tar.gz |
-rw-r--r-- | agg-plot/canvas-window.cpp | 13 |
diff --git a/agg-plot/canvas-window.cpp b/agg-plot/canvas-window.cpp index 9b73d5f1..9302b46e 100644 --- a/agg-plot/canvas-window.cpp +++ b/agg-plot/canvas-window.cpp @@ -47,9 +47,9 @@ static int canvas_window_stroke (lua_State *L); static int canvas_window_clear (lua_State *L); static int canvas_window_refresh (lua_State *L); static int canvas_window_set_box_trans (lua_State *L); +static int canvas_window_index_protected (lua_State *L); static void * canvas_thread_function (void *_win); -static int canvas_window_index_protected (lua_State *L); static int canvas_window_draw_gener (lua_State *L, bool as_line); static const struct luaL_Reg canvas_win_functions[] = { @@ -248,6 +248,17 @@ canvas_window_close (lua_State *L) } int +canvas_window_close_protected (lua_State *L) +{ + canvas_window *win = canvas_window::check (L, 1); + win->lock(); + if (win->status == canvas_window::running) + win->close(); + win->unlock(); + return 0; +} + +int canvas_window_index_protected (lua_State *L) { canvas_window *win = canvas_window::check(L, lua_upvalueindex(2)); |