Merge pull request #8713 from grundman:patch-6

This commit is contained in:
Alexander Alekhin 2017-05-24 12:34:12 +00:00
commit 7bd3ccd929

View File

@ -222,16 +222,20 @@ public:
};
namespace
{
MatAllocator* g_matAllocator = NULL;
MatAllocator* volatile g_matAllocator = NULL;
}
MatAllocator* Mat::getDefaultAllocator()
{
if (g_matAllocator == NULL)
{
cv::AutoLock lock(cv::getInitializationMutex());
if (g_matAllocator == NULL)
{
g_matAllocator = getStdAllocator();
}
}
return g_matAllocator;
}
void Mat::setDefaultAllocator(MatAllocator* allocator)