diff options
author | Hieu Hoang <s0565741@odin.inf.ed.ac.uk> | 2014-04-23 18:12:27 +0400 |
---|---|---|
committer | Hieu Hoang <s0565741@odin.inf.ed.ac.uk> | 2014-04-23 18:12:27 +0400 |
commit | 6a9eb6c848f12711b0a7ac2994fe06bf6491fd23 (patch) | |
tree | 4eaa4ed86573fbf7327527eee1fdb464e69d0f3b /moses/PrefixTreeMap.h | |
parent | 4ee4e07c1bf2f1fdf56fadf67a606b8945989978 (diff) |
minor leak showing for lex reordering. Just refactor
Diffstat (limited to 'moses/PrefixTreeMap.h')
-rw-r--r-- | moses/PrefixTreeMap.h | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/moses/PrefixTreeMap.h b/moses/PrefixTreeMap.h index 06066878d..d6262ca65 100644 --- a/moses/PrefixTreeMap.h +++ b/moses/PrefixTreeMap.h @@ -99,18 +99,11 @@ public: PrefixTreeMap() : m_FileSrc(0), m_FileTgt(0) { PTF::setDefault(InvalidOffT); } - ~PrefixTreeMap() { - if(m_FileSrc) { - fClose(m_FileSrc); - } - if(m_FileTgt) { - fClose(m_FileTgt); - } - FreeMemory(); - } + ~PrefixTreeMap(); + public: static const LabelId MagicWord; -public: + void FreeMemory(); int Read(const std::string& fileNameStem, int numVocs = -1); @@ -135,6 +128,7 @@ private: std::vector<WordVoc*> m_Voc; ObjectPool<PPimp> m_PtrPool; + std::map<std::string,WordVoc> m_vocs; }; } |