summaryrefslogtreecommitdiff
path: root/src/vte.cc
diff options
context:
space:
mode:
authorChristian Persch <chpe@src.gnome.org>2020-12-01 22:05:58 +0100
committerChristian Persch <chpe@src.gnome.org>2020-12-01 22:05:58 +0100
commitcede6dac6bd281ebcf1e259b25079ceafb39ea0b (patch)
tree7487234c0d41c252eae956e44b00d358e004d501 /src/vte.cc
parent5d74cff80f63022a9d39f6dc598013da5a5b1412 (diff)
downloadvte-cede6dac6bd281ebcf1e259b25079ceafb39ea0b.tar.gz
ring: Fix image memory leak
... and various code correctness and style issues. Use unique_ptr instead of naked new/delete, and use a std::multimap for m_image_by_top_map. https://gitlab.gnome.org/GNOME/vte/-/issues/255
Diffstat (limited to 'src/vte.cc')
-rw-r--r--src/vte.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vte.cc b/src/vte.cc
index f32c8632..b5df3d24 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -9200,10 +9200,10 @@ Terminal::widget_draw(cairo_t *cr)
if (m_images_enabled) {
vte::grid::row_t top_row = first_displayed_row();
vte::grid::row_t bottom_row = last_displayed_row();
- auto image_map = ring->m_image_priority_map;
- auto it = image_map->begin ();
- for (; it != image_map->end (); ++it) {
- vte::image::Image *image = it->second;
+ auto const& image_map = ring->image_map();
+ auto const image_map_end = image_map.end();
+ for (auto it = image_map.begin(); it != image_map_end; ++it) {
+ auto const& image = it->second;
if (image->get_bottom() < top_row ||
image->get_top() > bottom_row)