Introduced window registry and changed win/plot weak table to ordinary. - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/lua-gsl.c
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2011年02月03日 15:56:02 +0100
committerfrancesco-ST <francesco.abbate@st.com>2011年02月03日 15:56:02 +0100
commitf9f49265522fe933fd6ca726ecd23bf33c9aae09 (patch)
tree59a12e3870bca9379cd99adf673ce0aa6536656e /lua-gsl.c
parent9cd1461d668ec3c38700a5a88fc9bd1fd9b79cc3 (diff)
downloadgsl-shell-f9f49265522fe933fd6ca726ecd23bf33c9aae09.tar.gz
Introduced window registry and changed win/plot weak table to ordinary.
Now the table that store the window <-> plot relations is no more weak on the keys (windows). The windows are removed from the table when the event loop thread of the windows terminates. In this way we don't depend on the GC and we avoid the problems with delayed removal of the keys.
Diffstat (limited to 'lua-gsl.c')
-rw-r--r--lua-gsl.c 27
1 files changed, 23 insertions, 4 deletions
diff --git a/lua-gsl.c b/lua-gsl.c
index 17976872..b1e055b6 100644
--- a/lua-gsl.c
+++ b/lua-gsl.c
@@ -48,8 +48,7 @@
#include "interp.h"
#ifdef AGG_PLOT_ENABLED
-#include "object-index.h"
-#include "object-refs.h"
+#include "window_registry.h"
#include "lua-draw.h"
#include "lua-text.h"
#include "window.h"
@@ -60,14 +59,23 @@
static const struct luaL_Reg gsl_methods_dummy[] = {{NULL, NULL}};
#endif
+#ifdef GSL_SHELL_DEBUG
+
+static int gsl_shell_lua_registry (lua_State *L);
+
+static const struct luaL_Reg gsl_shell_debug_functions[] = {
+ {"registry", gsl_shell_lua_registry},
+ {NULL, NULL}
+};
+#endif
+
int
luaopen_gsl (lua_State *L)
{
gsl_set_error_handler_off ();
#ifdef AGG_PLOT_ENABLED
- object_index_prepare (L);
- object_refs_prepare (L);
+ window_registry_prepare (L);
#endif
#ifdef LUA_STRICT
@@ -107,7 +115,18 @@ luaopen_gsl (lua_State *L)
ode_complex_register (L);
solver_complex_register (L);
+ luaL_register (L, NULL, gsl_shell_debug_functions);
+
lua_pop (L, 1);
return 1;
}
+
+#ifdef GSL_SHELL_DEBUG
+int
+gsl_shell_lua_registry (lua_State *L)
+{
+ lua_pushvalue (L, LUA_REGISTRYINDEX);
+ return 1;
+}
+#endif
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月28日 21:34:24 +0000

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