mirror of
https://github.com/opencv/opencv.git
synced 2024-11-26 04:00:30 +08:00
Merge pull request #8713 from grundman:patch-6
This commit is contained in:
commit
7bd3ccd929
@ -222,7 +222,7 @@ public:
|
||||
};
|
||||
namespace
|
||||
{
|
||||
MatAllocator* g_matAllocator = NULL;
|
||||
MatAllocator* volatile g_matAllocator = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -230,7 +230,11 @@ MatAllocator* Mat::getDefaultAllocator()
|
||||
{
|
||||
if (g_matAllocator == NULL)
|
||||
{
|
||||
g_matAllocator = getStdAllocator();
|
||||
cv::AutoLock lock(cv::getInitializationMutex());
|
||||
if (g_matAllocator == NULL)
|
||||
{
|
||||
g_matAllocator = getStdAllocator();
|
||||
}
|
||||
}
|
||||
return g_matAllocator;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user