summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-02-12 16:29:18 +0100
committer Miodrag Milanovic <mmicko@gmail.com>2016-02-12 16:29:18 +0100
commite8f547428d6a544b5d36a2d11d1f597e44543e3e (patch)
treef518e4139ae259d6c15c011570aa74f912a5ebb9
parente7e6420ca7ada52e8df29739832aab6d4f943b94 (diff)
proper memory handling (nw)
-rw-r--r--src/osd/modules/render/drawbgfx.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp
index 6a0b1ca448f..35a50609cf4 100644
--- a/src/osd/modules/render/drawbgfx.cpp
+++ b/src/osd/modules/render/drawbgfx.cpp
@@ -127,6 +127,8 @@ int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks)
static void drawbgfx_exit(void)
{
+ // Shutdown bgfx.
+ bgfx::shutdown();
}
//============================================================
@@ -196,20 +198,15 @@ int renderer_bgfx::create()
void renderer_bgfx::destroy()
{
- // free the memory in the window
- if (window().m_index == 0)
+ if (window().m_index > 0)
{
- // destroy_all_textures();
- //
- bgfx::destroyUniform(m_s_texColor);
- // Cleanup.
- bgfx::destroyProgram(m_progQuad);
- bgfx::destroyProgram(m_progQuadTexture);
- bgfx::destroyProgram(m_progLine);
-
- // Shutdown bgfx.
- bgfx::shutdown();
+ bgfx::destroyFrameBuffer(fbh);
}
+ bgfx::destroyUniform(m_s_texColor);
+ // Cleanup.
+ bgfx::destroyProgram(m_progQuad);
+ bgfx::destroyProgram(m_progQuadTexture);
+ bgfx::destroyProgram(m_progLine);
}