Issue #529: cleanup

This commit is contained in:
Raf Schietekat 2017-05-12 23:09:44 +02:00
parent 6bebe71749
commit 9a5ed19cf6

View File

@ -241,11 +241,12 @@ void Dict::Load(const STRING &lang, TessdataManager *data_file) {
if (load_bigram_dawg) {
bigram_dawg_ = dawg_cache_->GetSquishedDawg(lang, TESSDATA_BIGRAM_DAWG,
dawg_debug_level, data_file);
if (bigram_dawg_) dawgs_ += bigram_dawg_;
}
if (load_freq_dawg) {
freq_dawg_ = dawg_cache_->GetSquishedDawg(lang, TESSDATA_FREQ_DAWG,
dawg_debug_level, data_file);
if (freq_dawg_) { dawgs_ += freq_dawg_; }
if (freq_dawg_) dawgs_ += freq_dawg_;
}
if (load_unambig_dawg) {
unambig_dawg_ = dawg_cache_->GetSquishedDawg(lang, TESSDATA_UNAMBIG_DAWG,
@ -351,7 +352,6 @@ void Dict::End() {
delete dawgs_[i];
}
}
dawg_cache_->FreeDawg(bigram_dawg_);
if (dawg_cache_is_ours_) {
delete dawg_cache_;
dawg_cache_ = NULL;