From d957e8e40d8cc7771f05e504c1727281652a4450 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Tue, 4 Feb 2014 19:47:58 +0400 Subject: [PATCH] attempt to fix pure virtual call in Mat::deallocate --- modules/core/src/matrix.cpp | 4 ++-- modules/core/src/ocl.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 8a11d09..a90ca5c 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -222,8 +222,8 @@ public: MatAllocator* Mat::getStdAllocator() { - static StdMatAllocator allocator; - return &allocator; + static MatAllocator * allocator = new StdMatAllocator(); + return allocator; } void swap( Mat& a, Mat& b ) diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index 6f19b56..9dd9f05 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -3959,8 +3959,8 @@ public: MatAllocator* getOpenCLAllocator() { - static OpenCLAllocator allocator; - return &allocator; + static MatAllocator * allocator = new OpenCLAllocator(); + return allocator; } ///////////////////////////////////////////// Utility functions ///////////////////////////////////////////////// -- 2.7.4