mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
5c58e1f868
commit
5c65ed2390
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue