summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-12-17 00:26:36 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-16 15:57:25 -1000
commit5c65ed2390d3772bd6773464c928e58b7585ba3c (patch)
tree5c02c1165e7f14d8758be7c8533dea76aa706567
parent5c58e1f8686c9b36daf8f1733e53b1f56d4ef123 (diff)
downloadsubsurface-5c65ed2390d3772bd6773464c928e58b7585ba3c.tar.gz
Clear associated tooltip texts when calling expose_event()
In gtk-gui.c:expose_event(), right before clearing the list of tooltips, we also want to free memory for the associated texts for each one of them. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--gtk-gui.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 2731f4f9e..4d795be1d 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -1387,6 +1387,7 @@ static int zoom_x = -1, zoom_y = -1;
static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
+ int i = 0;
struct dive *dive = current_dive;
static struct graphics_context gc = { .printer = 0 };
@@ -1411,6 +1412,11 @@ static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer
if (dive) {
if (tooltip_rects) {
+ while (i < tooltips) {
+ if (tooltip_rects[i].text)
+ free((void *)tooltip_rects[i].text);
+ i++;
+ }
free(tooltip_rects);
tooltip_rects = NULL;
}