From 5a309e8f6e1d5184fe6bd5e1f22fdaaa856c4250 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 11 Oct 2013 20:24:26 +0400 Subject: [PATCH] fft cleanup ignoring --- modules/ocl/src/fft.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/ocl/src/fft.cpp b/modules/ocl/src/fft.cpp index abaa0f5002..6e4fc4d7cd 100644 --- a/modules/ocl/src/fft.cpp +++ b/modules/ocl/src/fft.cpp @@ -133,16 +133,21 @@ void cv::ocl::fft_setup() void cv::ocl::fft_teardown() { PlanCache& pCache = *PlanCache::getPlanCache(); + if(!pCache.started) - { return; - } + for(size_t i = 0; i < pCache.planStore.size(); i ++) - { delete pCache.planStore[i]; - } pCache.planStore.clear(); - openCLSafeCall( clAmdFftTeardown( ) ); + + try + { + openCLSafeCall( clAmdFftTeardown( ) ); + } + catch (const std::bad_alloc &) + { } + delete pCache.setupData; pCache.setupData = NULL; pCache.started = false; }