Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2020-05-18 08:29:36 +0300
committerTaku Kudo <taku@google.com>2020-05-18 08:29:36 +0300
commit8970682ca6828f168909be7bbe701f6905ad123e (patch)
tree590f06a25681fedffa685b3e45c77ee25e04783e
parent680c8c6a2af92282fed0f71f422aa4a3a7c7cd2a (diff)
fixed test failure.
-rw-r--r--python/sentencepiece.i4
-rw-r--r--python/sentencepiece_wrap.cxx4
2 files changed, 6 insertions, 2 deletions
diff --git a/python/sentencepiece.i b/python/sentencepiece.i
index e909506..784411b 100644
--- a/python/sentencepiece.i
+++ b/python/sentencepiece.i
@@ -105,7 +105,9 @@ class PySentenceIterator : public sentencepiece::SentenceIterator {
CopyValue();
}
- ~PySentenceIterator() {}
+ ~PySentenceIterator() {
+ if (iter_) Py_DECREF(iter_);
+ }
bool done() const override {
return item_ == nullptr;
diff --git a/python/sentencepiece_wrap.cxx b/python/sentencepiece_wrap.cxx
index e47b780..3bced05 100644
--- a/python/sentencepiece_wrap.cxx
+++ b/python/sentencepiece_wrap.cxx
@@ -2876,7 +2876,9 @@ class PySentenceIterator : public sentencepiece::SentenceIterator {
CopyValue();
}
- ~PySentenceIterator() {}
+ ~PySentenceIterator() {
+ if (iter_) Py_DECREF(iter_);
+ }
bool done() const override {
return item_ == nullptr;