author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年11月05日 22:36:34 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年11月05日 22:36:34 +0100 |
commit | 27daeb255ca7b9035881b0f995fbfe4986bfc37c (patch) | |
tree | 59b780786cf2c7f42049dfb7acbb10574d8a1072 /agg-plot/window-cpp.h | |
parent | 6c3c3823077f90a3bf870fa75fc0818d9f31f3d3 (diff) | |
download | gsl-shell-27daeb255ca7b9035881b0f995fbfe4986bfc37c.tar.gz |
-rw-r--r-- | agg-plot/window-cpp.h | 17 |
diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h index 32d294c4..f1b257f1 100644 --- a/agg-plot/window-cpp.h +++ b/agg-plot/window-cpp.h @@ -41,18 +41,13 @@ public: : plot(p), matrix(), layer_buf(0), valid_rect(true), dirty_rect() {}; - ~ref() { - if (layer_buf) delete layer_buf; - }; + ~ref() { delete[] layer_buf; } void dispose_buffer() { valid_rect = false; - if (layer_buf) - { - delete [] layer_buf; - layer_buf = 0; - } + delete[] layer_buf; + layer_buf = 0; } void save_image (agg::rendering_buffer& winbuf, agg::rect_base<int>& r, @@ -79,11 +74,9 @@ public: canvas_window(gs, bgcol), m_tree(0) { this->split("."); - }; + } - ~window() { - if (m_tree) delete m_tree; - }; + ~window() { delete m_tree; } template <class Function> void plot_apply(Function& f) { this->plot_apply_rec(f, m_tree); } |