From 64e29675b294101b8ff7c0f1cda390d7f03e79c0 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 11 Jan 2015 22:15:42 -0500 Subject: [PATCH] Fixed crash on unload (delete) of uninitialized stateIdentifier --- src/openalpr/alpr_impl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openalpr/alpr_impl.cpp b/src/openalpr/alpr_impl.cpp index f697897..0d9f7d8 100644 --- a/src/openalpr/alpr_impl.cpp +++ b/src/openalpr/alpr_impl.cpp @@ -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; }