fixed problem with weak table pair removals - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2010年08月29日 23:01:21 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2010年08月29日 23:01:21 +0200
commit176e096a8e6923c06395ba3668eb38c69257116b (patch)
tree8cb4ee3f2200fef1150ee28aef815dbaad72c84c
parent32cb1ed9940cbfb02fc1fc73ef2e73a2b30e516b (diff)
downloadgsl-shell-176e096a8e6923c06395ba3668eb38c69257116b.tar.gz
fixed problem with weak table pair removals
Diffstat
-rw-r--r--agg-plot/window.cpp 7
-rw-r--r--base.lua 2
-rw-r--r--gsl-shell.c 4
-rw-r--r--lua/src/lgc.c 13
4 files changed, 17 insertions, 9 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index dbd2a24c..c45d3bc8 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -319,13 +319,8 @@ window_slot_update (lua_State *L)
if (win->status == canvas_window::running)
{
win->draw_slot(slot_id, true);
- win->unlock();
- }
- else
- {
- win->unlock();
- luaL_error (L, "window is not running");
}
+ win->unlock();
return 0;
}
diff --git a/base.lua b/base.lua
index 5a4cf71f..005437b1 100644
--- a/base.lua
+++ b/base.lua
@@ -14,7 +14,7 @@ local function tos(t, maxdepth)
for i, v in ipairs(t) do insert(ls, tos(v, maxdepth-1)) end
for k, v in pairs(t) do
if type(k) ~= 'number' or k < 1 or k > n then
- insert(ls, k .. '= ' .. tos(v, maxdepth-1))
+ insert(ls, tos(k, 1) .. '= ' .. tos(v, maxdepth-1))
end
end
return '{' .. cat(ls, ', ') .. '}'
diff --git a/gsl-shell.c b/gsl-shell.c
index a271d0ae..1b1f170f 100644
--- a/gsl-shell.c
+++ b/gsl-shell.c
@@ -339,7 +339,9 @@ static void do_windows_unref (lua_State *L)
GSL_SHELL_LOCK();
for (j = 0; j < unref_fixed_count; j++)
- object_index_remove (L, OBJECT_WINDOW, unref_fixed_list[j]);
+ {
+ object_index_remove (L, OBJECT_WINDOW, unref_fixed_list[j]);
+ }
unref_fixed_count = 0;
diff --git a/lua/src/lgc.c b/lua/src/lgc.c
index d9e0b782..83bbc4c2 100644
--- a/lua/src/lgc.c
+++ b/lua/src/lgc.c
@@ -334,6 +334,17 @@ static size_t propagateall (global_State *g) {
** other objects: if really collected, cannot keep them; for userdata
** being finalized, keep them in keys, but not in values
*/
+#ifdef GSL_SHELL_LUA
+static int iscleared (const TValue *o, int iskey) {
+ (void) iskey;
+ if (!iscollectable(o)) return 0;
+ if (ttisstring(o)) {
+ stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */
+ return 0;
+ }
+ return iswhite(gcvalue(o)) || (ttisuserdata(o) && isfinalized(uvalue(o)));
+}
+#else
static int iscleared (const TValue *o, int iskey) {
if (!iscollectable(o)) return 0;
if (ttisstring(o)) {
@@ -343,7 +354,7 @@ static int iscleared (const TValue *o, int iskey) {
return iswhite(gcvalue(o)) ||
(ttisuserdata(o) && (!iskey && isfinalized(uvalue(o))));
}
-
+#endif
/*
** clear collected entries from weaktables
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月15日 20:49:18 +0000

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