diff --git a/modules/features2d/src/matchers.cpp b/modules/features2d/src/matchers.cpp index 6c1e9fb0ad..ff3a3aabba 100755 --- a/modules/features2d/src/matchers.cpp +++ b/modules/features2d/src/matchers.cpp @@ -914,7 +914,8 @@ void OneWayDescriptorMatcher::clear() GenericDescriptorMatcher::clear(); prevTrainCount = 0; - base->clear(); + if( !base.empty() ) + base->clear(); } void OneWayDescriptorMatcher::train()