Преглед изворни кода

Clear bgfx context in single-threaded mode.

Branimir Karadžić пре 10 година
родитељ
комит
5f9c6df918
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      src/bgfx.cpp

+ 3 - 0
src/bgfx.cpp

@@ -1026,6 +1026,8 @@ namespace bgfx
 		}
 		}
 
 
 		m_render->destroy();
 		m_render->destroy();
+#else
+		s_ctx = NULL;
 #endif // BGFX_CONFIG_MULTITHREADED
 #endif // BGFX_CONFIG_MULTITHREADED
 
 
 		m_submit->destroy();
 		m_submit->destroy();
@@ -2020,6 +2022,7 @@ again:
 		BGFX_CHECK_MAIN_THREAD();
 		BGFX_CHECK_MAIN_THREAD();
 		Context* ctx = s_ctx; // it's going to be NULLd inside shutdown.
 		Context* ctx = s_ctx; // it's going to be NULLd inside shutdown.
 		ctx->shutdown();
 		ctx->shutdown();
+		BX_CHECK(NULL == s_ctx, "bgfx is should be uninitialized here.");
 
 
 		BX_ALIGNED_DELETE(g_allocator, ctx, 16);
 		BX_ALIGNED_DELETE(g_allocator, ctx, 16);