There's a nasty warning in the build about a "delete" on a
pointer-to-KenOSMBase.  KenOSMBase needs a virtual destructor.

KenOSMBase is the base class for instantiations of the KenOSM abstract
template class, so the actual type of the object that's being deleted is
not known statically.  In theory the delete produces undefined
behaviour; in practice I expect it will simply fail to clean up the
model object.

Patch attached.  The KenOSM destructor can be left implicit, so long as
virtual dispatch is in place to ensure that the right one is called.


Jeroen
diff --git a/moses/FF/OSM-Feature/KenOSM.h b/moses/FF/OSM-Feature/KenOSM.h
index a50589e..03deead 100644
--- a/moses/FF/OSM-Feature/KenOSM.h
+++ b/moses/FF/OSM-Feature/KenOSM.h
@@ -10,6 +10,8 @@ namespace Moses
 class KenOSMBase
 {
 public:
+  virtual ~KenOSMBase() {}
+
   virtual float Score(const lm::ngram::State&, const std::string&,
                       lm::ngram::State&) const = 0;
 
_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to