From f677c974fa2f164f047ac9d31a80c4e0a531d52d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 19 Jan 2013 11:53:48 +0100 Subject: [PATCH] (XDK) Cleanup xdk_ctx_driver_destroy --- gfx/context/xdk_ctx.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gfx/context/xdk_ctx.c b/gfx/context/xdk_ctx.c index 62a675bdde..0c478fc5e7 100644 --- a/gfx/context/xdk_ctx.c +++ b/gfx/context/xdk_ctx.c @@ -411,8 +411,17 @@ static void gfx_ctx_xdk_destroy(void) { xdk_d3d_video_t * d3d = (xdk_d3d_video_t*)driver.video_data; - d3d->d3d_render_device->Release(); - d3d->d3d_device->Release(); + if (d3d->d3d_render_device) + { + d3d->d3d_render_device->Release(); + d3d->d3d_render_device = 0; + } + + if (d3d->d3d_device) + { + d3d->d3d_device->Release(); + d3d->d3d_device = 0; + } } static void gfx_ctx_xdk_input_driver(const input_driver_t **input, void **input_data) { }