The performance correction. The previous filters should be removed from the global context otherwise a list of filters is quickly extended. Test case is a lines creation by clicks in the viewer.
// a list of filters in the global context is not cleared and should be cleared here
SelectMgr_ListOfFilter aFilters;
aFilters.Assign(aContext->Filters());
+ // it is important to remove the filters in the global context, because there is a code
+ // in the closeLocalContex, which restore the global context filters
+ aContext->RemoveFilters();
//aContext->ClearCurrents();
aContext->OpenLocalContext();