diff options
author | Simon Rettberg | 2019-02-18 11:55:58 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-02-18 11:55:58 +0100 |
commit | aa7530630e595b80d5db54655fd827b61edc0fd7 (patch) | |
tree | 048cb74072450c7592f254c3537ac8f252d09d73 /hacks/glx/fliptext.c | |
parent | Forgot one DPMS killing instance (diff) | |
parent | Update to 5.42 (diff) | |
download | xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.gz xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.xz xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.zip |
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/glx/fliptext.c')
-rw-r--r-- | hacks/glx/fliptext.c | 22 |
1 files changed, 15 insertions, 7 deletions
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) |