1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

fix MatAllocator creation/destruction issues

This commit is contained in:
Alexander Alekhin
2015-06-18 14:02:01 +03:00
parent b98a54fbe0
commit 032b6322fc
2 changed files with 13 additions and 4 deletions
+6 -2
View File
@@ -222,10 +222,14 @@ public:
}
};
static StdMatAllocator *mat_allocator = NULL;
MatAllocator* Mat::getStdAllocator()
{
static StdMatAllocator allocator;
return &allocator;
if (mat_allocator == NULL)
{
mat_allocator = new StdMatAllocator();
}
return mat_allocator;
}
void swap( Mat& a, Mat& b )