summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
51e562c)
This resolves some order dependencies between the already existing
callback the newly created one.
Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
{
xmesa_destroy_buffers_on_display(dpy);
destroy_visuals_on_display(dpy);
{
xmesa_destroy_buffers_on_display(dpy);
destroy_visuals_on_display(dpy);
+ xmesa_close_display(dpy);
typedef struct _XMesaExtDisplayInfo {
struct _XMesaExtDisplayInfo *next;
Display *display;
typedef struct _XMesaExtDisplayInfo {
struct _XMesaExtDisplayInfo *next;
Display *display;
struct xmesa_display mesaDisplay;
} XMesaExtDisplayInfo;
struct xmesa_display mesaDisplay;
} XMesaExtDisplayInfo;
static XMesaExtInfo MesaExtInfo;
/* hook to delete XMesaDisplay on XDestroyDisplay */
static XMesaExtInfo MesaExtInfo;
/* hook to delete XMesaDisplay on XDestroyDisplay */
-static int
-xmesa_close_display(Display *display, XExtCodes *codes)
+extern void
+xmesa_close_display(Display *display)
{
XMesaExtDisplayInfo *info, *prev;
{
XMesaExtDisplayInfo *info, *prev;
if (info == NULL) {
/* no display found */
_XUnlockMutex(_Xglobal_lock);
if (info == NULL) {
/* no display found */
_XUnlockMutex(_Xglobal_lock);
}
/* remove display entry from list */
}
/* remove display entry from list */
free(xmdpy->smapi);
XFree((char *) info);
free(xmdpy->smapi);
XFree((char *) info);
return NULL;
}
info->display = display;
return NULL;
}
info->display = display;
- info->codes = XAddExtension(display);
- if (info->codes == NULL) {
- /* could not allocate extension. Fail */
- Xfree(info);
- pipe_mutex_unlock(init_mutex);
- return NULL;
- }
- XESetCloseDisplay(display, info->codes->extension, xmesa_close_display);
xmdpy = &info->mesaDisplay; /* to be filled out below */
/* chain to the list of displays */
xmdpy = &info->mesaDisplay; /* to be filled out below */
/* chain to the list of displays */
_XUnlockMutex(_Xglobal_lock);
/* now create the new XMesaDisplay info */
_XUnlockMutex(_Xglobal_lock);
/* now create the new XMesaDisplay info */
- if (display) {
- xmdpy->display = display;
- xmdpy->screen = driver.create_pipe_screen(display);
- xmdpy->smapi = CALLOC_STRUCT(st_manager);
- xmdpy->pipe = NULL;
- if (xmdpy->smapi) {
- xmdpy->smapi->screen = xmdpy->screen;
- xmdpy->smapi->get_param = xmesa_get_param;
- }
+ assert(display);
+
+ xmdpy->display = display;
+ xmdpy->screen = driver.create_pipe_screen(display);
+ xmdpy->smapi = CALLOC_STRUCT(st_manager);
+ xmdpy->pipe = NULL;
+ if (xmdpy->smapi) {
+ xmdpy->smapi->screen = xmdpy->screen;
+ xmdpy->smapi->get_param = xmesa_get_param;
+ }
- if (xmdpy->screen && xmdpy->smapi) {
- pipe_mutex_init(xmdpy->mutex);
+ if (xmdpy->screen && xmdpy->smapi) {
+ pipe_mutex_init(xmdpy->mutex);
+ }
+ else {
+ if (xmdpy->screen) {
+ xmdpy->screen->destroy(xmdpy->screen);
+ xmdpy->screen = NULL;
- else {
- if (xmdpy->screen) {
- xmdpy->screen->destroy(xmdpy->screen);
- xmdpy->screen = NULL;
- }
- free(xmdpy->smapi);
- xmdpy->smapi = NULL;
+ free(xmdpy->smapi);
+ xmdpy->smapi = NULL;
- xmdpy->display = NULL;
- }
- if (!xmdpy->display || xmdpy->display != display)
- xmdpy = NULL;
pipe_mutex_unlock(init_mutex);
pipe_mutex_unlock(init_mutex);
extern void
xmesa_destroy_buffers_on_display(Display *dpy);
extern void
xmesa_destroy_buffers_on_display(Display *dpy);
+extern void
+xmesa_close_display(Display *dpy);
+
static inline GLuint
xmesa_buffer_width(XMesaBuffer b)
{
static inline GLuint
xmesa_buffer_width(XMesaBuffer b)
{