From dd24b2ad75847ea728553d9eba5002551c7b4525 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 30 Sep 2019 18:24:13 -0700 Subject: [PATCH] dynamic_cast may not be defined during dtor --- src/factory/FieldCreateFactory.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/factory/FieldCreateFactory.cpp b/src/factory/FieldCreateFactory.cpp index 14e34f6..9637411 100644 --- a/src/factory/FieldCreateFactory.cpp +++ b/src/factory/FieldCreateFactory.cpp @@ -58,9 +58,8 @@ struct FieldCreate::Helper { std::pair itp(create->cache.equal_range(hash)); for(; itp.first!=itp.second; ++itp.first) { - Field* cent(itp.first->second); - FLD* centx(dynamic_cast(cent)); - if(centx && compare(*centx, *ent)) { + Field* const cent(itp.first->second); + if(compare(*cent, *ent)) { try{ ent = std::tr1::static_pointer_cast(cent->shared_from_this()); return;