From 71d1ab1a9607d1e2e6e36a8492be184358bb36c6 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Fri, 4 Jun 2021 22:42:57 -0700 Subject: [PATCH] [statusview] fix leak in set_stitch_value() --- src/statusview_curses.cc | 14 ++++++++++++++ src/statusview_curses.hh | 12 +----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/statusview_curses.cc b/src/statusview_curses.cc index 4079e70d..bcb724e3 100644 --- a/src/statusview_curses.cc +++ b/src/statusview_curses.cc @@ -70,6 +70,20 @@ void status_field::do_cylon() } } +void status_field::set_stitch_value(view_colors::role_t left, + view_colors::role_t right) +{ + string_attrs_t &sa = this->sf_value.get_attrs(); + struct line_range lr(0, 1); + + this->sf_value.get_string() = "::"; + sa.clear(); + sa.emplace_back(lr, &view_curses::VC_ROLE, left); + lr.lr_start = 1; + lr.lr_end = 2; + sa.emplace_back(lr, &view_curses::VC_ROLE, right); +} + void statusview_curses::do_update() { int top, attrs, field, field_count, left = 0, right; diff --git a/src/statusview_curses.hh b/src/statusview_curses.hh index 2a311b44..790df644 100644 --- a/src/statusview_curses.hh +++ b/src/statusview_curses.hh @@ -78,17 +78,7 @@ public: return *this; }; - void set_stitch_value(view_colors::role_t left, view_colors::role_t right) - { - string_attrs_t &sa = this->sf_value.get_attrs(); - struct line_range lr(0, 1); - - this->sf_value.get_string() = "::"; - sa.emplace_back(lr, &view_curses::VC_ROLE, left); - lr.lr_start = 1; - lr.lr_end = 2; - sa.emplace_back(lr, &view_curses::VC_ROLE, right); - }; + void set_stitch_value(view_colors::role_t left, view_colors::role_t right); void set_left_pad(size_t val) { this->sf_left_pad = val; }; size_t get_left_pad() const { return this->sf_left_pad; };