diff options
Diffstat (limited to 'xorg-server/glx/glxdriswrast.c')
-rw-r--r-- | xorg-server/glx/glxdriswrast.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/xorg-server/glx/glxdriswrast.c b/xorg-server/glx/glxdriswrast.c index d064a0536..434653e70 100644 --- a/xorg-server/glx/glxdriswrast.c +++ b/xorg-server/glx/glxdriswrast.c @@ -26,6 +26,10 @@ #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> +#else + +#include "glheader.h" + #endif #include <stdint.h> @@ -54,13 +58,6 @@ #include "dispatch.h" #include "extension_string.h" -/* RTLD_LOCAL is not defined on Cygwin */ -#ifdef __CYGWIN__ -#ifndef RTLD_LOCAL -#define RTLD_LOCAL 0 -#endif -#endif - typedef struct __GLXDRIscreen __GLXDRIscreen; typedef struct __GLXDRIcontext __GLXDRIcontext; typedef struct __GLXDRIdrawable __GLXDRIdrawable; @@ -247,14 +244,18 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen) (*screen->core->destroyScreen)(screen->driScreen); +#ifdef _MSC_VER + FreeLibrary(screen->driver); +#else dlclose(screen->driver); +#endif __glXScreenDestroy(baseScreen); if (screen->driConfigs) { for (i = 0; screen->driConfigs[i] != NULL; i++) free((__DRIconfig **)screen->driConfigs[i]); - free(screen->driConfigs); + free((void*)screen->driConfigs); } free(screen); @@ -333,6 +334,13 @@ __glXDRIscreenCreateDrawable(ClientPtr client, (*driScreen->swrast->createNewDrawable)(driScreen->driScreen, config->driConfig, private); + if (!private->driDrawable) + { + FreeGC(private->gc, (GContext)0); + FreeGC(private->swapgc, (GContext)0); + free(private); + return NULL; + } return &private->base; } @@ -430,11 +438,18 @@ initializeExtensions(__GLXDRIscreen *screen) } } +extern Bool g_fswrastwgl; + static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { - const char *driverName = "swrast"; + const char *driverName; __GLXDRIscreen *screen; + + if (g_fswrastwgl) + driverName = "swrastwgl"; + else + driverName = "swrast"; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -486,7 +501,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen) handle_error: if (screen->driver) +#ifdef _MSC_VER + FreeLibrary(screen->driver); +#else dlclose(screen->driver); +#endif free(screen); |