- if (planets != NULL) {
- int screen;
-
- for (screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
- planetstruct *gp = &planets[screen];
-
- if (gp->glx_context) {
- /* Display lists MUST be freed while their glXContext is current. */
- /* but this gets a BadMatch error. -jwz */
- /*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);
- }
- }
- (void) free((void *) planets);
- planets = NULL;
+ planetstruct *gp = &planets[MI_SCREEN(mi)];
+
+ if (gp->glx_context) {
+ 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);