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/glplanet.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'hacks/glx/glplanet.c') diff --git a/hacks/glx/glplanet.c b/hacks/glx/glplanet.c index f26a4ad..a2f6889 100644 --- a/hacks/glx/glplanet.c +++ b/hacks/glx/glplanet.c @@ -178,6 +178,7 @@ setup_xpm_texture (ModeInfo *mi, const unsigned char *data, unsigned long size) GL_RGBA, GL_UNSIGNED_BYTE, image->data); sprintf (buf, "builtin texture (%dx%d)", image->width, image->height); check_gl_error(buf); + XDestroyImage (image); } @@ -399,7 +400,7 @@ reshape_planet (ModeInfo *mi, int width, int height) planetstruct *gp = &planets[MI_SCREEN(mi)]; GLfloat h = (GLfloat) height / (GLfloat) width; - glXMakeCurrent(MI_DISPLAY(mi), gp->window, *(gp->glx_context)); + glXMakeCurrent(MI_DISPLAY(mi), gp->window, *gp->glx_context); glViewport(0, 0, (GLint) width, (GLint) height); glMatrixMode(GL_PROJECTION); @@ -587,7 +588,7 @@ draw_planet (ModeInfo * mi) glDrawBuffer(GL_BACK); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glXMakeCurrent (dpy, window, *(gp->glx_context)); + glXMakeCurrent (dpy, window, *gp->glx_context); mi->polygon_count = 0; @@ -831,14 +832,18 @@ free_planet (ModeInfo * mi) { planetstruct *gp = &planets[MI_SCREEN(mi)]; - if (gp->glx_context) { - glXMakeCurrent(MI_DISPLAY(mi), gp->window, *(gp->glx_context)); + if (!gp->glx_context) return; + glXMakeCurrent(MI_DISPLAY(mi), gp->window, *gp->glx_context); - if (glIsList(gp->platelist)) - glDeleteLists(gp->platelist, 1); - if (glIsList(gp->starlist)) - glDeleteLists(gp->starlist, 1); - } + if (glIsList(gp->platelist)) glDeleteLists(gp->platelist, 1); + if (glIsList(gp->shadowlist)) glDeleteLists(gp->shadowlist, 1); + if (glIsList(gp->latlonglist)) glDeleteLists(gp->latlonglist, 1); + if (glIsList(gp->starlist)) glDeleteLists(gp->starlist, 1); + glDeleteTextures(1, &gp->tex1); + glDeleteTextures(1, &gp->tex2); + + if (gp->trackball) gltrackball_free (gp->trackball); + if (gp->rot) free_rotator (gp->rot); } -- cgit v1.2.3-55-g7522