summaryrefslogtreecommitdiffstats
path: root/hacks/glx/fliptext.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/fliptext.c')
-rw-r--r--hacks/glx/fliptext.c22
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)