From 11e2a216c513e302e6bc1c475c40b7717fbb8ed0 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 10 Oct 2018 18:04:39 +0000 Subject: [PATCH] ocl(win32): bypass deallocate() during process termination --- modules/core/src/ocl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index 0e98c08659..42aaf8da29 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -4779,6 +4779,10 @@ public: void deallocate_(UMatData* u) const { +#ifdef _WIN32 + if (cv::__termination) // process is not in consistent state (after ExitProcess call) and terminating + return; // avoid any OpenCL calls +#endif if(u->tempUMat()) { CV_Assert(u->origdata);