summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gfx_layout.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp
index 4148d0548..62fb75bc9 100644
--- a/src/gfx_layout.cpp
+++ b/src/gfx_layout.cpp
@@ -420,8 +420,10 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi
if (!this->fonts.Contains(buff - this->buffer)) {
this->fonts.Insert(buff - this->buffer, f);
- f = new Font(fontsize, cur_colour);
+ } else {
+ delete f;
}
+ f = new Font(fontsize, cur_colour);
}
/* Better safe than sorry. */