added initial code to manage memory allocation error - 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>2010年09月01日 16:01:32 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年09月01日 16:01:32 +0200
commit4806d8bdb82b3c6a221caa3d73d7541c5721a530 (patch)
treefa6a69a6738f5265582a38cd2f157bc07ddf057c /agg-plot/window.cpp
parent31ed0541a835746f4788d76286f1facea2fcf5aa (diff)
downloadgsl-shell-4806d8bdb82b3c6a221caa3d73d7541c5721a530.tar.gz
added initial code to manage memory allocation error
The code should be tested and improved, this is a first implementation.
Diffstat (limited to 'agg-plot/window.cpp')
-rw-r--r--agg-plot/window.cpp 7
1 files changed, 2 insertions, 5 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index c45d3bc8..00372b65 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -251,7 +251,7 @@ int window::attach(lua_plot *plot, const char *spec)
int
window_new (lua_State *L)
{
- window *win = new(L, GS_WINDOW) window(colors::white);
+ window *win = push_new_object<window>(L, GS_WINDOW, colors::white);
win->start_new_thread (L);
return 1;
}
@@ -259,12 +259,9 @@ window_new (lua_State *L)
int
window_free (lua_State *L)
{
- window *win = window::check (L, 1);
- win->~window();
- return 0;
+ return object_free<window>(L, 1, GS_WINDOW);
}
-
int
window_split (lua_State *L)
{
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月14日 05:41:48 +0000

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