Fixed crash on unload (delete) of uninitialized stateIdentifier

This commit is contained in:
Matt Hill 2015-01-11 22:15:42 -05:00
parent 70dbe38762
commit 64e29675b2

View File

@ -29,13 +29,14 @@ namespace alpr
AlprImpl::AlprImpl(const std::string country, const std::string configFile, const std::string runtimeDir)
{
config = new Config(country, configFile, runtimeDir);
plateDetector = ALPR_NULL_PTR;
stateIdentifier = ALPR_NULL_PTR;
ocr = ALPR_NULL_PTR;
// Config file or runtime dir not found. Don't process any further.
if (config->loaded == false)
{
plateDetector = ALPR_NULL_PTR;
stateIdentifier = ALPR_NULL_PTR;
ocr = ALPR_NULL_PTR;
return;
}