OpenNMT / CTranslate

Lightweight C++ translator for OpenNMT Torch models (deprecated)
https://opennmt.net/
MIT License
79 stars 50 forks source link

segfault from destructor when instantiating multiple instances of translator #10

Closed jungikim closed 7 years ago

jungikim commented 7 years ago

Instantiating and translating with multiple instances of translator works fine. But destroying these instances results in a Segmentation fault.

Minimal example:

#include <memory>
#include "onmt/onmt.h"

int main(int argc, char **argv){
  std::unique_ptr<onmt::ITranslator> translator1 = onmt::TranslatorFactory::build("model1.t7");
  std::unique_ptr<onmt::ITranslator> translator2 = onmt::TranslatorFactory::build("model2.t7");
  return 0;
}