Commit 47007224 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #15359 from mgehre:fix_dangling_pointer

parents b77a0039 0e92ac2a
...@@ -205,7 +205,7 @@ void traceOpenCLCheck(cl_int status, const char* message) ...@@ -205,7 +205,7 @@ void traceOpenCLCheck(cl_int status, const char* message)
CV_OCL_TRACE_CHECK_RESULT(check_result, msg); \ CV_OCL_TRACE_CHECK_RESULT(check_result, msg); \
if (check_result != CL_SUCCESS) \ if (check_result != CL_SUCCESS) \
{ \ { \
if (0) { const char* msg_ = (msg); CV_UNUSED(msg_); /* ensure const char* type (cv::String without c_str()) */ } \ static_assert(std::is_convertible<decltype(msg), const char*>::value, "msg of CV_OCL_CHECK_RESULT must be const char*"); \
cv::String error_msg = CV_OCL_API_ERROR_MSG(check_result, msg); \ cv::String error_msg = CV_OCL_API_ERROR_MSG(check_result, msg); \
CV_Error(Error::OpenCLApiCallError, error_msg); \ CV_Error(Error::OpenCLApiCallError, error_msg); \
} \ } \
...@@ -225,7 +225,7 @@ void traceOpenCLCheck(cl_int status, const char* message) ...@@ -225,7 +225,7 @@ void traceOpenCLCheck(cl_int status, const char* message)
CV_OCL_TRACE_CHECK_RESULT(check_result, msg); \ CV_OCL_TRACE_CHECK_RESULT(check_result, msg); \
if (check_result != CL_SUCCESS && isRaiseError()) \ if (check_result != CL_SUCCESS && isRaiseError()) \
{ \ { \
if (0) { const char* msg_ = (msg); CV_UNUSED(msg_); /* ensure const char* type (cv::String without c_str()) */ } \ static_assert(std::is_convertible<decltype(msg), const char*>::value, "msg of CV_OCL_DBG_CHECK_RESULT must be const char*"); \
cv::String error_msg = CV_OCL_API_ERROR_MSG(check_result, msg); \ cv::String error_msg = CV_OCL_API_ERROR_MSG(check_result, msg); \
CV_Error(Error::OpenCLApiCallError, error_msg); \ CV_Error(Error::OpenCLApiCallError, error_msg); \
} \ } \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment