Fix #22765: Remove unnecessary function resulting in infinite recursion. Since In all four places it was used, we already check the shared pointer, the extra assert that the function provided was redundand, so I removed it, and I added a dereference to the `window` parameters.

pull/22804/head
Dan Mašek 2 years ago
parent da4ac6b7ef
commit 51b897b672
  1. 14
      modules/highgui/src/window_w32.cpp

@ -2337,12 +2337,6 @@ std::shared_ptr<CvTrackbar> icvFindTrackbarByName(CvWindow& window, const std::s
}
return std::shared_ptr<CvTrackbar>();
}
static inline
std::shared_ptr<CvTrackbar> icvFindTrackbarByName(const std::shared_ptr<CvWindow>& window, const std::string& name)
{
CV_Assert(window);
return icvFindTrackbarByName(window, name);
}
static
std::shared_ptr<CvTrackbar> createTrackbar_(CvWindow& window, const std::string& trackbar_name,
@ -2586,7 +2580,7 @@ CV_IMPL int cvGetTrackbarPos(const char* trackbar_name, const char* window_name)
if (!window)
CV_Error_(Error::StsNullPtr, ("NULL window: '%s'", window_name));
auto trackbar = icvFindTrackbarByName(window, trackbar_name);
auto trackbar = icvFindTrackbarByName(*window, trackbar_name);
if (!trackbar)
CV_Error_(Error::StsNullPtr, ("NULL trackbar: '%s'", trackbar_name));
@ -2607,7 +2601,7 @@ CV_IMPL void cvSetTrackbarPos(const char* trackbar_name, const char* window_name
if (!window)
CV_Error_(Error::StsNullPtr, ("NULL window: '%s'", window_name));
auto trackbar = icvFindTrackbarByName(window, trackbar_name);
auto trackbar = icvFindTrackbarByName(*window, trackbar_name);
if (!trackbar)
CV_Error_(Error::StsNullPtr, ("NULL trackbar: '%s'", trackbar_name));
@ -2639,7 +2633,7 @@ CV_IMPL void cvSetTrackbarMax(const char* trackbar_name, const char* window_name
if (!window)
CV_Error_(Error::StsNullPtr, ("NULL window: '%s'", window_name));
auto trackbar = icvFindTrackbarByName(window, trackbar_name);
auto trackbar = icvFindTrackbarByName(*window, trackbar_name);
if (!trackbar)
CV_Error_(Error::StsNullPtr, ("NULL trackbar: '%s'", trackbar_name));
@ -2668,7 +2662,7 @@ CV_IMPL void cvSetTrackbarMin(const char* trackbar_name, const char* window_name
if (!window)
CV_Error_(Error::StsNullPtr, ("NULL window: '%s'", window_name));
auto trackbar = icvFindTrackbarByName(window, trackbar_name);
auto trackbar = icvFindTrackbarByName(*window, trackbar_name);
if (!trackbar)
CV_Error_(Error::StsNullPtr, ("NULL trackbar: '%s'", trackbar_name));

Loading…
Cancel
Save