diff --git a/api/capi.cpp b/api/capi.cpp index d4fedf988a..99605d271e 100644 --- a/api/capi.cpp +++ b/api/capi.cpp @@ -724,8 +724,9 @@ TESS_API const TessPageIterator* TESS_CALL TessResultIteratorGetPageIteratorCons TESS_API const TessChoiceIterator* TESS_CALL TessResultIteratorGetChoiceIterator(const TessResultIterator* handle) { - return new TessChoiceIterator(*handle); + return new TessChoiceIterator(*handle); } + TESS_API BOOL TESS_CALL TessResultIteratorNext(TessResultIterator* handle, TessPageIteratorLevel level) { return handle->Next(level); @@ -788,17 +789,22 @@ TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterat return handle->SymbolIsDropcap() ? TRUE : FALSE; } +TESS_API void TESS_CALL TessChoiceIteratorDelete(TessChoiceIterator* handle) +{ + delete handle; +} + TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator* handle) { - return handle->Next(); + return handle->Next(); } TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator* handle) { - return handle->GetUTF8Text(); + return handle->GetUTF8Text(); } TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator* handle) { - return handle->Confidence(); + return handle->Confidence(); } diff --git a/api/capi.h b/api/capi.h index d731bd6f40..1cc8b6b716 100644 --- a/api/capi.h +++ b/api/capi.h @@ -367,6 +367,7 @@ TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSuperscript(const TessResultI TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsSubscript(const TessResultIterator* handle); TESS_API BOOL TESS_CALL TessResultIteratorSymbolIsDropcap(const TessResultIterator* handle); +TESS_API void TESS_CALL TessChoiceIteratorDelete(TessChoiceIterator* handle); TESS_API BOOL TESS_CALL TessChoiceIteratorNext(TessChoiceIterator* handle); TESS_API const char* TESS_CALL TessChoiceIteratorGetUTF8Text(const TessChoiceIterator* handle); TESS_API float TESS_CALL TessChoiceIteratorConfidence(const TessChoiceIterator* handle);