gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/canvas-window.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2010年08月08日 00:47:16 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2010年08月08日 00:47:16 +0200
commitedd594b48a302145178679af1719d1a85454dee4 (patch)
tree325bc8f04f91b81c4cf10fb2731a5cddc8dd74a9 /agg-plot/canvas-window.cpp
parent7ca6cb456b8517b97c9a063f07799b3babda3b5e (diff)
downloadgsl-shell-edd594b48a302145178679af1719d1a85454dee4.tar.gz
added missing lock when closing windows when terminating
Diffstat (limited to 'agg-plot/canvas-window.cpp')
-rw-r--r--agg-plot/canvas-window.cpp 13
1 files changed, 12 insertions, 1 deletions
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));
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月15日 16:11:37 +0000

AltStyle によって変換されたページ (->オリジナル) /