Commit 7bd3ccd9 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #8713 from grundman:patch-6

parents 37b1bc9d cf4e9e5c
...@@ -222,16 +222,20 @@ public: ...@@ -222,16 +222,20 @@ public:
}; };
namespace namespace
{ {
MatAllocator* g_matAllocator = NULL; MatAllocator* volatile g_matAllocator = NULL;
} }
MatAllocator* Mat::getDefaultAllocator() MatAllocator* Mat::getDefaultAllocator()
{ {
if (g_matAllocator == NULL)
{
cv::AutoLock lock(cv::getInitializationMutex());
if (g_matAllocator == NULL) if (g_matAllocator == NULL)
{ {
g_matAllocator = getStdAllocator(); g_matAllocator = getStdAllocator();
} }
}
return g_matAllocator; return g_matAllocator;
} }
void Mat::setDefaultAllocator(MatAllocator* allocator) void Mat::setDefaultAllocator(MatAllocator* allocator)
......
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