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);