Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11window.c @ 2322:c25d45b7add3
Fixing valgrind errors.
One of the error was the result of an unitended recursive call to X11_GL_LoadLibrary which was also fixed.
author | Bob Pendleton <bob@pendleton.com> |
---|---|
date | Thu, 06 Mar 2008 17:08:10 +0000 |
parents | c5feceb0395e |
children | 4ac07ae446d3 |
comparison
equal
deleted
inserted
replaced
2321:c5feceb0395e | 2322:c25d45b7add3 |
---|---|
53 videodata->classname, NULL); | 53 videodata->classname, NULL); |
54 } | 54 } |
55 #endif | 55 #endif |
56 data->created = created; | 56 data->created = created; |
57 data->videodata = videodata; | 57 data->videodata = videodata; |
58 | |
59 /* Associate the data with the window */ | |
60 windowlist = | |
61 (SDL_WindowData **) SDL_realloc(windowlist, | |
62 (numwindows + | |
63 1) * sizeof(*windowlist)); | |
64 if (!windowlist) { | |
65 SDL_OutOfMemory(); | |
66 SDL_free(data); | |
67 return -1; | |
68 } | |
69 windowlist[numwindows++] = data; | |
70 videodata->numwindows = numwindows; | |
71 videodata->windowlist = windowlist; | |
72 | 58 |
73 /* Fill in the SDL window with the window data */ | 59 /* Fill in the SDL window with the window data */ |
74 { | 60 { |
75 XWindowAttributes attrib; | 61 XWindowAttributes attrib; |
76 | 62 |
226 SDL_SetError | 212 SDL_SetError |
227 ("Couldn't create window:XA_RGB_BEST_MAP not found and could not be created"); | 213 ("Couldn't create window:XA_RGB_BEST_MAP not found and could not be created"); |
228 return -1; | 214 return -1; |
229 } | 215 } |
230 SDL_memcpy(&cmap, stdmaps, sizeof(XStandardColormap)); | 216 SDL_memcpy(&cmap, stdmaps, sizeof(XStandardColormap)); |
217 XFree(stdmaps); | |
231 } | 218 } |
232 | 219 |
233 /* OK, we have the best color map, now copy it for use by the | 220 /* OK, we have the best color map, now copy it for use by the |
234 program */ | 221 program */ |
235 | 222 |
653 #endif | 640 #endif |
654 if (data->created) { | 641 if (data->created) { |
655 XDestroyWindow(display, data->window); | 642 XDestroyWindow(display, data->window); |
656 } | 643 } |
657 SDL_free(data); | 644 SDL_free(data); |
645 window->driverdata = NULL; | |
658 } | 646 } |
659 } | 647 } |
660 | 648 |
661 SDL_bool | 649 SDL_bool |
662 X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) | 650 X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) |