mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
commit
29f3de9be1
@ -2064,12 +2064,10 @@ void TessBaseAPI::End() {
|
||||
delete paragraph_models_;
|
||||
paragraph_models_ = NULL;
|
||||
}
|
||||
if (tesseract_ != NULL) {
|
||||
delete tesseract_;
|
||||
if (osd_tesseract_ == tesseract_)
|
||||
osd_tesseract_ = NULL;
|
||||
tesseract_ = NULL;
|
||||
}
|
||||
if (osd_tesseract_ == tesseract_)
|
||||
osd_tesseract_ = nullptr;
|
||||
delete tesseract_;
|
||||
tesseract_ = nullptr;
|
||||
delete osd_tesseract_;
|
||||
osd_tesseract_ = NULL;
|
||||
delete equ_detect_;
|
||||
|
@ -1009,13 +1009,13 @@ int UNICHARSET::add_script(const char* script) {
|
||||
if (script_table_size_reserved == 0) {
|
||||
script_table_size_reserved = 8;
|
||||
script_table = new char*[script_table_size_reserved];
|
||||
}
|
||||
if (script_table_size_used + 1 >= script_table_size_reserved) {
|
||||
char** new_script_table = new char*[script_table_size_reserved * 2];
|
||||
memcpy(new_script_table, script_table, script_table_size_reserved * sizeof(char*));
|
||||
} else if (script_table_size_used >= script_table_size_reserved) {
|
||||
assert(script_table_size_used == script_table_size_reserved);
|
||||
script_table_size_reserved += script_table_size_reserved;
|
||||
char** new_script_table = new char*[script_table_size_reserved];
|
||||
memcpy(new_script_table, script_table, script_table_size_used * sizeof(char*));
|
||||
delete[] script_table;
|
||||
script_table = new_script_table;
|
||||
script_table_size_reserved = 2 * script_table_size_reserved;
|
||||
}
|
||||
script_table[script_table_size_used] = new char[strlen(script) + 1];
|
||||
strcpy(script_table[script_table_size_used], script);
|
||||
|
Loading…
Reference in New Issue
Block a user