Unverified Commit ee3baed1 by Carlos Martín Nieto Committed by GitHub

Merge pull request #4724 from libgit2/cmn/allocator-init-order

alloc: don't overwrite allocator during init if set
parents 2510268a 19007b19
......@@ -17,6 +17,13 @@ git_allocator git__allocator;
int git_allocator_global_init(void)
{
/*
* We don't want to overwrite any allocator which has been set before
* the init function is called.
*/
if (git__allocator.gmalloc != NULL)
return 0;
#if defined(GIT_MSVC_CRTDBG)
return git_win32_crtdbg_init_allocator(&git__allocator);
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment