From ae69a754244c4e475c8d2591772ca8e005071d83 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Feb 2019 11:55:41 +0100 Subject: Update to 5.42 --- hacks/glx/fliptext.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'hacks/glx/fliptext.c') diff --git a/hacks/glx/fliptext.c b/hacks/glx/fliptext.c index c233e8b..951c188 100644 --- a/hacks/glx/fliptext.c +++ b/hacks/glx/fliptext.c @@ -798,6 +798,7 @@ ENTRYPOINT void init_fliptext (ModeInfo *mi) { int wire = MI_IS_WIREFRAME(mi); + char *s; fliptext_configuration *sc; @@ -897,9 +898,9 @@ init_fliptext (ModeInfo *mi) if (min_lines > max_lines - 3) min_lines = max_lines - 4; if (min_lines < 1) min_lines = 1; - parse_color (mi, "foreground", - get_string_resource(mi->dpy, "foreground", "Foreground"), - sc->color); + s = get_string_resource(mi->dpy, "foreground", "Foreground"); + parse_color (mi, "foreground", s, sc->color); + if (s) free (s); sc->top_margin = (sc->char_width * 100); sc->bottom_margin = -sc->top_margin; @@ -919,7 +920,7 @@ draw_fliptext (ModeInfo *mi) if (!sc->glx_context) return; - glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(sc->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sc->glx_context); #if 0 if (XtAppPending (app) & (XtIMTimer|XtIMAlternateInput)) @@ -989,11 +990,18 @@ ENTRYPOINT void free_fliptext (ModeInfo *mi) { fliptext_configuration *sc = &scs[MI_SCREEN(mi)]; + int i; + if (!sc->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *sc->glx_context); if (sc->tc) textclient_close (sc->tc); - free(sc->lines); - - /* #### there's more to free here */ + if (sc->texfont) free_texture_font (sc->texfont); + for (i = 0; i < sc->nlines; i++) + if (sc->lines[i]) { + if (sc->lines[i]->text) free (sc->lines[i]->text); + free (sc->lines[i]); + } + if(sc->lines) free(sc->lines); } XSCREENSAVER_MODULE ("FlipText", fliptext) -- cgit v1.2.3-55-g7522