Added a function to the C binding to free a char* pointer

This commit is contained in:
Matt Hill
2016-10-17 22:58:43 -04:00
parent 90a4b2be0e
commit d2d07100ab
2 changed files with 13 additions and 1 deletions

View File

@@ -21,7 +21,8 @@
#include <alpr.h>
#include <string.h>
#include <vector>
#include <stdlib.h>
OPENALPRC_DLL_EXPORT OPENALPR* openalpr_init(const char* country, const char* configFile, const char* runtimeDir)
{
alpr::Alpr* alpr_inst = new alpr::Alpr(country, configFile, runtimeDir);
@@ -99,6 +100,12 @@ OPENALPRC_DLL_EXPORT char* openalpr_recognize_encodedimage(OPENALPR* instance, u
return result_obj;
}
OPENALPRC_DLL_EXPORT void openalpr_free_response_string(char* response)
{
free(response);
}
OPENALPRC_DLL_EXPORT void openalpr_cleanup(OPENALPR* instance)
{
delete ((alpr::Alpr*) instance);