mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts: CMakeLists.txt cmake/OpenCVDetectCUDA.cmake doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.rst modules/core/src/cmdparser.cpp modules/gpu/CMakeLists.txt modules/gpu/doc/introduction.rst modules/gpu/perf/perf_video.cpp modules/highgui/doc/reading_and_writing_images_and_video.rst modules/ocl/src/cl_context.cpp modules/video/include/opencv2/video/background_segm.hpp samples/cpp/image_sequence.cpp samples/cpp/tutorial_code/ImgTrans/HoughCircle_Demo.cpp samples/python/chessboard.py samples/python/cvutils.py samples/python/demhist.py samples/python/dft.py samples/python/distrans.py samples/python/edge.py samples/python/ffilldemo.py samples/python/fitellipse.py samples/python/houghlines.py samples/python/inpaint.py samples/python/logpolar.py samples/python/morphology.py samples/python/numpy_array.py samples/python/watershed.py
This commit is contained in:
@@ -192,6 +192,7 @@ void openCLMallocPitchEx(Context *ctx, void **dev_ptr, size_t *pitch,
|
||||
clFinish(getClCommandQueue(ctx));
|
||||
#endif
|
||||
CheckBuffers data(mainBuffer, size, widthInBytes, height);
|
||||
cv::AutoLock lock(getInitializationMutex());
|
||||
__check_buffers.insert(std::pair<cl_mem, CheckBuffers>((cl_mem)*dev_ptr, data));
|
||||
}
|
||||
#endif
|
||||
@@ -253,10 +254,17 @@ void openCLFree(void *devPtr)
|
||||
bool failBefore = false, failAfter = false;
|
||||
#endif
|
||||
CheckBuffers data;
|
||||
std::map<cl_mem, CheckBuffers>::iterator i = __check_buffers.find((cl_mem)devPtr);
|
||||
if (i != __check_buffers.end())
|
||||
{
|
||||
data = i->second;
|
||||
cv::AutoLock lock(getInitializationMutex());
|
||||
std::map<cl_mem, CheckBuffers>::iterator i = __check_buffers.find((cl_mem)devPtr);
|
||||
if (i != __check_buffers.end())
|
||||
{
|
||||
data = i->second;
|
||||
__check_buffers.erase(i);
|
||||
}
|
||||
}
|
||||
if (data.mainBuffer != NULL)
|
||||
{
|
||||
#ifdef CHECK_MEMORY_CORRUPTION
|
||||
Context* ctx = Context::getContext();
|
||||
std::vector<uchar> checkBefore(__memory_corruption_guard_bytes);
|
||||
@@ -286,7 +294,6 @@ void openCLFree(void *devPtr)
|
||||
clFinish(getClCommandQueue(ctx));
|
||||
#endif
|
||||
openCLSafeCall(clReleaseMemObject(data.mainBuffer));
|
||||
__check_buffers.erase(i);
|
||||
}
|
||||
#if defined(CHECK_MEMORY_CORRUPTION)
|
||||
if (failBefore)
|
||||
|
||||
Reference in New Issue
Block a user