From 43b209a5c0ab225cf002d33ad82f4fb2ab392e18 Mon Sep 17 00:00:00 2001 From: OV2 Date: Sat, 8 Feb 2014 19:56:02 +0100 Subject: [PATCH] D3D9: use new during init so that constructors are run --- gfx/d3d9/d3d.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gfx/d3d9/d3d.cpp b/gfx/d3d9/d3d.cpp index 80cb0170fe..ec7f39610e 100644 --- a/gfx/d3d9/d3d.cpp +++ b/gfx/d3d9/d3d.cpp @@ -576,6 +576,8 @@ static void d3d_free(void *data) #endif DestroyWindow(d3d->hWnd); + delete d3d; + #ifndef _XBOX UnregisterClass("RetroArch", GetModuleHandle(NULL)); #endif @@ -1083,7 +1085,7 @@ static const gfx_ctx_driver_t *d3d_get_context(void) static void *d3d_init(const video_info_t *info, const input_driver_t **input, void **input_data) { - D3DVideo *vid = (D3DVideo*)calloc(1, sizeof(D3DVideo)); + D3DVideo *vid = new D3DVideo; if (!vid) return NULL;