static void winFreeFBShadowDDNL(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; /* Free the shadow surface, if there is one */ if (pScreenPriv->pddsShadow4) { IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4); free (pScreenInfo->pfb); pScreenInfo->pfb = NULL; pScreenPriv->pddsShadow4 = NULL; } /* Detach the clipper from the primary surface and release the primary surface, if there is one */ winReleasePrimarySurfaceShadowDDNL(pScreen); /* Release the clipper object */ if (pScreenPriv->pddcPrimary) { IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); pScreenPriv->pddcPrimary = NULL; } /* Free the DirectDraw4 object, if there is one */ if (pScreenPriv->pdd4) { IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4); IDirectDraw4_Release (pScreenPriv->pdd4); pScreenPriv->pdd4 = NULL; } /* Free the DirectDraw object, if there is one */ if (pScreenPriv->pdd) { IDirectDraw_Release (pScreenPriv->pdd); pScreenPriv->pdd = NULL; } /* Invalidate the ScreenInfo's fb pointer */ pScreenInfo->pfb = NULL; }
static Bool winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; Bool fReturn; #if CYGDEBUG winDebug ("winCloseScreenShadowDDNL - Freeing screen resources\n"); #endif /* Flag that the screen is closed */ pScreenPriv->fClosed = TRUE; pScreenPriv->fActive = FALSE; /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); /* Free the screen DC */ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); /* Delete the window property */ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); /* Free the shadow surface, if there is one */ if (pScreenPriv->pddsShadow4) { IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4); free (pScreenInfo->pfb); pScreenInfo->pfb = NULL; pScreenPriv->pddsShadow4 = NULL; } /* Detach the clipper from the primary surface and release the clipper. */ if (pScreenPriv->pddcPrimary) { /* Detach the clipper */ IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4, NULL); /* Release the clipper object */ IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); pScreenPriv->pddcPrimary = NULL; } /* Release the primary surface, if there is one */ if (pScreenPriv->pddsPrimary4) { IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4); pScreenPriv->pddsPrimary4 = NULL; } /* Free the DirectDraw4 object, if there is one */ if (pScreenPriv->pdd4) { IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4); IDirectDraw4_Release (pScreenPriv->pdd4); pScreenPriv->pdd4 = NULL; } /* Free the DirectDraw object, if there is one */ if (pScreenPriv->pdd) { IDirectDraw_Release (pScreenPriv->pdd); pScreenPriv->pdd = NULL; } /* Delete tray icon, if we have one */ if (!pScreenInfo->fNoTrayIcon) winDeleteNotifyIcon (pScreenPriv); /* Free the exit confirmation dialog box, if it exists */ if (g_hDlgExit != NULL) { DestroyWindow (g_hDlgExit); g_hDlgExit = NULL; } /* Kill our window */ if (pScreenPriv->hwndScreen) { DestroyWindow (pScreenPriv->hwndScreen); pScreenPriv->hwndScreen = NULL; } #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) /* Destroy the thread startup mutex */ pthread_mutex_destroy (&pScreenPriv->pmServerStarted); #endif /* Kill our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; /* Invalidate the ScreenInfo's fb pointer */ pScreenInfo->pfb = NULL; /* Free the screen privates for this screen */ free ((pointer) pScreenPriv); return fReturn; }
Bool winCloseScreenShadowDDNL (int nIndex, ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; Bool fReturn; #if CYGDEBUG ErrorF ("winCloseScreenShadowDDNL - Freeing screen resources\n"); #endif /* Flag that the screen is closed */ pScreenPriv->fClosed = TRUE; pScreenPriv->fActive = FALSE; /* Call the wrapped CloseScreen procedure */ pScreen->CloseScreen = pScreenPriv->CloseScreen; fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); /* Free the screen DC */ ReleaseDC (pScreenPriv->hwndScreen, pScreenPriv->hdcScreen); /* Delete the window property */ RemoveProp (pScreenPriv->hwndScreen, WIN_SCR_PROP); /* Free the shadow surface, if there is one */ if (pScreenPriv->pddsShadow4) { IDirectDrawSurface4_Release (pScreenPriv->pddsShadow4); free (pScreenInfo->pfb); pScreenInfo->pfb = NULL; pScreenPriv->pddsShadow4 = NULL; } /* Detach the clipper from the primary surface and release the clipper. */ if (pScreenPriv->pddcPrimary) { /* Detach the clipper */ IDirectDrawSurface4_SetClipper (pScreenPriv->pddsPrimary4, NULL); /* Release the clipper object */ IDirectDrawClipper_Release (pScreenPriv->pddcPrimary); pScreenPriv->pddcPrimary = NULL; } /* Release the primary surface, if there is one */ if (pScreenPriv->pddsPrimary4) { IDirectDrawSurface4_Release (pScreenPriv->pddsPrimary4); pScreenPriv->pddsPrimary4 = NULL; } /* Free the DirectDraw4 object, if there is one */ if (pScreenPriv->pdd4) { IDirectDraw4_RestoreDisplayMode (pScreenPriv->pdd4); IDirectDraw4_Release (pScreenPriv->pdd4); pScreenPriv->pdd4 = NULL; } /* Free the DirectDraw object, if there is one */ if (pScreenPriv->pdd) { IDirectDraw_Release (pScreenPriv->pdd); pScreenPriv->pdd = NULL; } /* Kill our window */ if (pScreenPriv->hwndScreen) { DestroyWindow (pScreenPriv->hwndScreen); pScreenPriv->hwndScreen = NULL; } /* Destroy the thread startup mutex */ pthread_mutex_destroy (&pScreenPriv->pmServerStarted); /* Kill our screeninfo's pointer to the screen */ pScreenInfo->pScreen = NULL; /* Invalidate the ScreenInfo's fb pointer */ pScreenInfo->pfb = NULL; /* Free the screen privates for this screen */ free ((pointer) pScreenPriv); return fReturn; }