src/video/win32/SDL_d3drender.c
changeset 1920 8a162bfdc838
parent 1918 092bd3a019c5
child 1921 f3399f779a1d
--- a/src/video/win32/SDL_d3drender.c	Wed Jul 19 08:46:57 2006 +0000
+++ b/src/video/win32/SDL_d3drender.c	Sat Jul 22 08:33:18 2006 +0000
@@ -239,20 +239,18 @@
     D3DPRESENT_PARAMETERS pparams;
     IDirect3DSwapChain9 *chain;
 
-    renderer = (SDL_Renderer *) SDL_malloc(sizeof(*renderer));
+    renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(*renderer));
     if (!renderer) {
         SDL_OutOfMemory();
         return NULL;
     }
-    SDL_zerop(renderer);
 
-    data = (D3D_RenderData *) SDL_malloc(sizeof(*data));
+    data = (D3D_RenderData *) SDL_calloc(1, sizeof(*data));
     if (!data) {
         D3D_DestroyRenderer(renderer);
         SDL_OutOfMemory();
         return NULL;
     }
-    SDL_zerop(data);
 
     renderer->CreateTexture = D3D_CreateTexture;
     renderer->SetTexturePalette = D3D_SetTexturePalette;
@@ -379,12 +377,11 @@
     D3DPOOL pool;
     HRESULT result;
 
-    data = (D3D_TextureData *) SDL_malloc(sizeof(*data));
+    data = (D3D_TextureData *) SDL_calloc(1, sizeof(*data));
     if (!data) {
         SDL_OutOfMemory();
         return -1;
     }
-    SDL_zerop(data);
 
     texture->driverdata = data;