From c08e38acd017f6c73a1657e5e12b1609d3a80334 Mon Sep 17 00:00:00 2001 From: Dale Phurrough Date: Wed, 25 Nov 2020 01:53:41 +0100 Subject: [PATCH] fix missing addref() in ocl::Context::create(str) - fix https://github.com/opencv/opencv/issues/18906 - unable to add related test cases as there is no public access to Context:Impl refcounts --- modules/core/src/ocl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/core/src/ocl.cpp b/modules/core/src/ocl.cpp index a9bd974b9a..44ee8f9c59 100644 --- a/modules/core/src/ocl.cpp +++ b/modules/core/src/ocl.cpp @@ -2437,6 +2437,7 @@ public: if (impl) { CV_LOG_INFO(NULL, "OpenCL: reuse context@" << impl->contextId << " for configuration: " << configuration) + impl->addref(); return impl; }