Assertion in algorithm.cpp thrown (Bug #2101)
Description
in our framework, the modules using opencv are dynamically loaded. During loading the modules a second time, the assertion
CV_Assert( i == 0 || vec[i].first != vec[i-1].first );
in line 65 of algorithm.cpp is thrown due to duplicates in the vector. I suppose due to the staticness the old values are still there.
In my code, I added "if (!alglist().find(_name, create))" to the following method in algorithm.cpp:
AlgorithmInfo::AlgorithmInfo(const string& _name, Algorithm::Constructor create)
{
data = new AlgorithmInfoData;
data->_name = _name;
if (!alglist().find(_name, create))
alglist().add(_name, create);
}
Would this be a solution to be integrated in one of the next versions? Otherwise, I suppose, the vector is perhaps not cleared correctly during shutdown.
Thanks
Stephan
Associated revisions
partial fix for repeated algorithm registration (patch #2101 by Stephan Reuter)
Corrected package name in tutorial
See also #2101
Corrected package name in tutorial
See also #2101(cherry picked from commit ae795e5797ba3b85812d56edc7fe497d05cc2d77)
History
Updated by Andrey Kamaev over 12 years ago
- Category set to core
- Assignee set to Vadim Pisarevsky
Updated by Vadim Pisarevsky over 12 years ago
thanks! your patch was integrated to SVN, r8867. Not sure if it completely solves the problem, but this extra check does not hurt anyway.
- Target version set to 2.4.3
- Status changed from Open to Done
Updated by Andrey Kamaev over 12 years ago
- Target version changed from 2.4.3 to 2.4.2