gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window.cpp
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 /agg-plot/window.cpp
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 'agg-plot/window.cpp')
-rw-r--r--agg-plot/window.cpp 11
1 files changed, 5 insertions, 6 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index 398efbdc..11120575 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -6,11 +6,10 @@ extern "C" {
#include "lua-defs.h"
#include "window-cpp.h"
+#include "window_registry.h"
#include "lua-draw.h"
#include "lua-cpp-utils.h"
#include "gs-types.h"
-#include "object-refs.h"
-#include "object-index.h"
#include "colors.h"
#include "lua-plot-cpp.h"
#include "split-parser.h"
@@ -289,7 +288,7 @@ window::cleanup_tree_rec (lua_State *L, int window_index, ref::node* n)
if (ref)
{
if (ref->plot)
- object_refs_remove (L, table_window_plot, ref->slot_id, window_index);
+ window_refs_remove (L, ref->slot_id, window_index);
}
}
@@ -420,12 +419,12 @@ void window::start (lua_State *L, gslshell::ret_status& st)
typedef canvas_window::thread_info thread_info;
std::auto_ptr<thread_info> inf(new thread_info(L, this));
- this->window_id = object_index_add (L, -1);
+ this->window_id = window_index_add (L, -1);
inf->window_id = this->window_id;
if (! this->start_new_thread (inf))
{
- object_index_remove (L, this->window_id);
+ window_index_remove (L, this->window_id);
this->unlock();
st.error("error during thread initialization", "window creation");
}
@@ -519,7 +518,7 @@ window_attach (lua_State *L)
if (win->status == canvas_window::running)
win->draw_slot(slot_id, true);
win->unlock();
- object_refs_add (L, table_window_plot, slot_id, 1, 2);
+ window_refs_add (L, slot_id, 1, 2);
}
else
{
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月12日 14:32:42 +0000

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