From 608e038b9657413fbbaac0d2b9de31594615526a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 8 Feb 2016 12:53:19 -0800 Subject: [PATCH] Manually merged PR #676. --- examples/common/nanovg/nanovg_bgfx.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index ffcc5002..1da34bd7 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -1024,6 +1024,10 @@ namespace } } + BX_FREE(gl->m_allocator, gl->uniforms); + BX_FREE(gl->m_allocator, gl->verts); + BX_FREE(gl->m_allocator, gl->paths); + BX_FREE(gl->m_allocator, gl->calls); BX_FREE(gl->m_allocator, gl->textures); BX_FREE(gl->m_allocator, gl); } @@ -1034,8 +1038,13 @@ NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId, bx::AllocatorI* _alloca { if (NULL == _allocator) { +#if BX_CONFIG_ALLOCATOR_CRT static bx::CrtAllocator allocator; _allocator = &allocator; +#else + BX_CHECK(false, "No allocator has been passed to nvgCreate(). Either specify a bx::AllocatorI instance or enable BX_CONFIG_ALLOCATOR_CRT directive."); + return NULL; +#endif // BX_CONFIG_ALLOCATOR_CRT } struct NVGparams params;