Added magic to detect already freed or otherwise invalid windows and textures.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404451
This commit is contained in:
Sam Lantinga 2010-01-24 20:21:51 +00:00
parent 80a88bc0d3
commit 73074be94a
2 changed files with 128 additions and 131 deletions

View file

@ -37,6 +37,7 @@ typedef struct SDL_VideoDevice SDL_VideoDevice;
/* Define the SDL texture structure */
struct SDL_Texture
{
const void *magic;
Uint32 format; /**< The pixel format of the texture */
int access; /**< SDL_TextureAccess */
int w; /**< The width of the texture */
@ -138,6 +139,7 @@ struct SDL_RenderDriver
/* Define the SDL window structure, corresponding to toplevel windows */
struct SDL_Window
{
const void *magic;
Uint32 id;
char *title;
int x, y;
@ -308,6 +310,8 @@ struct SDL_VideoDevice
int num_displays;
SDL_VideoDisplay *displays;
int current_display;
Uint8 window_magic;
Uint8 texture_magic;
Uint32 next_object_id;
/* * * */