mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
fix bug, see details in ChangeLog.md
This commit is contained in:
parent
8ca338d75a
commit
721b34f1bd
@ -1,5 +1,10 @@
|
||||
# CppJieba ChangeLog
|
||||
|
||||
## next version
|
||||
|
||||
+ 使用 valgrind 检查内存泄露的问题,定位出一个HMM模型初始化的问题导致内存泄露的bug,不过此内存泄露不是致命问题,
|
||||
因为只会在词典载入的时候发生,而词典载入通常情况下只会被运行一次,故不会导致致命问题。
|
||||
|
||||
## v4.4.0
|
||||
|
||||
+ 加代码容易删代码难,思索良久,还是决定把 Server 功能的源码剥离出这个项目。
|
||||
|
@ -11,8 +11,8 @@
|
||||
namespace cppjieba {
|
||||
class HMMSegment: public SegmentBase {
|
||||
public:
|
||||
HMMSegment(const string& filePath) {
|
||||
model_ = new HMMModel(filePath);
|
||||
HMMSegment(const string& filePath)
|
||||
: model_(new HMMModel(filePath)), isNeedDestroy_(true) {
|
||||
}
|
||||
HMMSegment(const HMMModel* model)
|
||||
: model_(model), isNeedDestroy_(false) {
|
||||
|
@ -12,9 +12,8 @@ namespace cppjieba {
|
||||
|
||||
class MPSegment: public SegmentBase {
|
||||
public:
|
||||
MPSegment(const string& dictPath, const string& userDictPath = "") {
|
||||
dictTrie_ = new DictTrie(dictPath, userDictPath);
|
||||
isNeedDestroy_ = true;
|
||||
MPSegment(const string& dictPath, const string& userDictPath = "")
|
||||
: dictTrie_(new DictTrie(dictPath, userDictPath)), isNeedDestroy_(true) {
|
||||
}
|
||||
MPSegment(const DictTrie* dictTrie)
|
||||
: dictTrie_(dictTrie), isNeedDestroy_(false) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user