Merge pull request #12088 from alalek:ocl_callback_catch_exceptions

pull/12036/head
Alexander Alekhin 6 years ago
commit 5bde800ee3
  1. 15
      modules/core/src/ocl.cpp

@ -2833,9 +2833,24 @@ struct Kernel::Impl
extern "C" {
static void CL_CALLBACK oclCleanupCallback(cl_event e, cl_int, void *p)
{
try
{
((cv::ocl::Kernel::Impl*)p)->finit(e);
}
catch (const cv::Exception& exc)
{
CV_LOG_ERROR(NULL, "OCL: Unexpected OpenCV exception in OpenCL callback: " << exc.what());
}
catch (const std::exception& exc)
{
CV_LOG_ERROR(NULL, "OCL: Unexpected C++ exception in OpenCL callback: " << exc.what());
}
catch (...)
{
CV_LOG_ERROR(NULL, "OCL: Unexpected unknown C++ exception in OpenCL callback");
}
}
}

Loading…
Cancel
Save