From 544643a77a901bc27fc17b7756764c1cb8ccc2a8 Mon Sep 17 00:00:00 2001 From: francesco-ST Date: Wed, 4 Aug 2010 15:26:20 +0200 Subject: added win32 platform specific functions to close windows Now all the windows are closed to close the main program to ensure proper object finalisations. --- agg-plot/canvas-window.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'agg-plot/canvas-window.cpp') diff --git a/agg-plot/canvas-window.cpp b/agg-plot/canvas-window.cpp index 927a69e7..73cfb81b 100644 --- a/agg-plot/canvas-window.cpp +++ b/agg-plot/canvas-window.cpp @@ -69,6 +69,7 @@ static const struct luaL_Reg canvas_window_methods_protected[] = { {"clear", canvas_window_clear}, {"refresh", canvas_window_refresh}, {"setview", canvas_window_set_box_trans}, + {"close", canvas_window_close}, {NULL, NULL} }; @@ -144,9 +145,11 @@ canvas_thread_function (void *_win) { win->status = canvas_window::running; win->run(); + printf("window id %d terminate.\n", win->id); win->status = canvas_window::closed; GSL_SHELL_LOCK(); + printf("request reference remove window id %d\n", win->id); gsl_shell_unref_plot (win->id); GSL_SHELL_UNLOCK(); } @@ -238,6 +241,14 @@ canvas_window_refresh (lua_State *L) return 0; } +int +canvas_window_close (lua_State *L) +{ + canvas_window *win = canvas_window::check (L, 1); + win->close(); + return 0; +} + int canvas_window_index_protected (lua_State *L) { -- cgit v1.2.3

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