Manually merged PR #676.

This commit is contained in:
Branimir Karadžić 2016-02-08 12:53:19 -08:00
parent 4a6c2b286c
commit 608e038b96

View file

@ -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->textures);
BX_FREE(gl->m_allocator, gl); BX_FREE(gl->m_allocator, gl);
} }
@ -1034,8 +1038,13 @@ NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId, bx::AllocatorI* _alloca
{ {
if (NULL == _allocator) if (NULL == _allocator)
{ {
#if BX_CONFIG_ALLOCATOR_CRT
static bx::CrtAllocator allocator; static bx::CrtAllocator allocator;
_allocator = &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; struct NVGparams params;