diff options
author | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-03-21 19:12:52 +0300 |
---|---|---|
committer | Ulrich Germann <ugermann@inf.ed.ac.uk> | 2015-03-21 19:12:52 +0300 |
commit | 8ca11d941d99df42664b32c101020283cc83054e (patch) | |
tree | eac36b128d9bfe22ff598458635ae66cdecbf57b /moses/TranslationModel | |
parent | 85d2567b57af592a3a902209c7b0f3675576aac7 (diff) |
1. Lifetime of tasks in ThreadPool is now managed via shared pointers.
2. Code cleanup in IOWrapper and a bit elsewhere.
Diffstat (limited to 'moses/TranslationModel')
-rw-r--r-- | moses/TranslationModel/CompactPT/BlockHashIndex.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/moses/TranslationModel/CompactPT/BlockHashIndex.h b/moses/TranslationModel/CompactPT/BlockHashIndex.h index 109044bb4..f8d526930 100644 --- a/moses/TranslationModel/CompactPT/BlockHashIndex.h +++ b/moses/TranslationModel/CompactPT/BlockHashIndex.h @@ -41,6 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include <time.h> #endif +#include <boost/shared_ptr.hpp> + namespace Moses { @@ -159,7 +161,9 @@ public: } #ifdef WITH_THREADS - HashTask<Keys>* ht = new HashTask<Keys>(current, *this, keys); + + boost::shared_ptr<HashTask<Keys> > + ht(new HashTask<Keys>(current, *this, keys)); m_threadPool.Submit(ht); #else CalcHash(current, keys); |