author | Francesco Abbate <francesco.bbt@gmail.com> | 2011年12月18日 00:02:19 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2011年12月18日 00:02:19 +0100 |
commit | ee563973094a8235631d5208bd672f8cbbe15fdc (patch) | |
tree | 6a72a6e6ece3cb9a96fc221f3e04922e63f42f00 /agg-plot/lua-plot.cpp | |
parent | ef0f158b491b4211c392ce4c4c50891b6d5631de (diff) | |
download | gsl-shell-ee563973094a8235631d5208bd672f8cbbe15fdc.tar.gz |
-rw-r--r-- | agg-plot/lua-plot.cpp | 28 |
diff --git a/agg-plot/lua-plot.cpp b/agg-plot/lua-plot.cpp index 252b2c56..8ea2ab81 100644 --- a/agg-plot/lua-plot.cpp +++ b/agg-plot/lua-plot.cpp @@ -165,23 +165,19 @@ plot_free (lua_State *L) void plot_add_gener_cpp (lua_State *L, sg_plot *p, bool as_line, - gslshell::ret_status& st) + gslshell::ret_status& st) { - try { - agg::rgba8 color; - sg_object* obj = parse_graph_args(L, color); - - AGG_LOCK(); - p->add(obj, color, as_line); - AGG_UNLOCK(); - - if (p->sync_mode()) - plot_flush (L); - } - catch (std::exception& e) - { - st.error(e.what(), "plot add or addline"); - } + agg::rgba8 color; + sg_object* obj = parse_graph_args(L, color, st); + + if (!obj) return; + + AGG_LOCK(); + p->add(obj, color, as_line); + AGG_UNLOCK(); + + if (p->sync_mode()) + plot_flush (L); } static void |