From f2a6a9203f69006b9aee94f96dc19d638047f67a Mon Sep 17 00:00:00 2001 From: francesco-ST Date: 2010年10月21日 17:54:30 +0200 Subject: changed scalable/drawable object base class to boxed pointers for Lua compat This change is meant to avoid to access object already deallocated by Lua. --- agg-plot/agg-parse-trans.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'agg-plot/agg-parse-trans.cpp') diff --git a/agg-plot/agg-parse-trans.cpp b/agg-plot/agg-parse-trans.cpp index 147aa8a3..d7f11d17 100644 --- a/agg-plot/agg-parse-trans.cpp +++ b/agg-plot/agg-parse-trans.cpp @@ -305,7 +305,8 @@ parse_graph_args (lua_State *L, agg::rgba8& color) if (gs_is_userdata (L, 2, GS_DRAW_SCALABLE)) { - scalable *s = (scalable *) lua_touserdata (L, 2); + vertex_source *vs = (vertex_source *) lua_touserdata (L, 2); + scalable *s = new boxed_scalable(vs); if (narg> 4) { @@ -323,7 +324,8 @@ parse_graph_args (lua_State *L, agg::rgba8& color) } else if (gs_is_userdata (L, 2, GS_DRAW_DRAWABLE)) { - w = (drawable *) lua_touserdata (L, 2); + vertex_source *vs = (vertex_source *) lua_touserdata (L, 2); + w = new boxed_drawable(vs); } else { -- cgit v1.2.3

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