[statusview] fix leak in set_stitch_value()

This commit is contained in:
Timothy Stack 2021-06-04 22:42:57 -07:00
parent 516d13d772
commit 71d1ab1a96
2 changed files with 15 additions and 11 deletions

View File

@ -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;

View File

@ -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; };