- if(glhanoi_cfg != NULL) {
- int screen;
- for(screen = 0; screen < MI_NUM_SCREENS(mi); screen++) {
- int i;
- int j;
- glhcfg *glh = &glhanoi_cfg[screen];
- glDeleteLists(glh->floorList, 1);
- glDeleteLists(glh->baseList, 1);
- glDeleteLists(glh->poleList, 1);
- glDeleteLists(glh->textureNames[0], 2);
- for(j = 0; j < glh->numberOfDisks; ++j) {
- glDeleteLists(glh->disk[j].displayList, 1);
- }
- free(glh->disk);
- for(i = 0; i < glh->numberOfPoles; i++) {
- if(glh->pole[i].data != NULL) {
- free(glh->pole[i].data);
- }
+ int i;
+ int j;
+ glhcfg *glh = &glhanoi_cfg[MI_SCREEN(mi)];
+ if (glh->glx_context) {
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(glh->glx_context));
+ glDeleteLists(glh->floorList, 1);
+ glDeleteLists(glh->baseList, 1);
+ glDeleteLists(glh->poleList, 1);
+ glDeleteLists(glh->textureNames[0], 2);
+ for(j = 0; j < glh->numberOfDisks; ++j) {
+ glDeleteLists(glh->disk[j].displayList, 1);
+ }
+ free(glh->disk);
+ for(i = 0; i < glh->numberOfPoles; i++) {
+ if(glh->pole[i].data != NULL) {
+ free(glh->pole[i].data);