diff --git a/core/src/zxing/common/CharacterSetECI.cpp b/core/src/zxing/common/CharacterSetECI.cpp index 8386208..44a81bb 100644 --- a/core/src/zxing/common/CharacterSetECI.cpp +++ b/core/src/zxing/common/CharacterSetECI.cpp @@ -24,8 +24,8 @@ using std::string; using zxing::common::CharacterSetECI; using zxing::IllegalArgumentException; -std::map CharacterSetECI::VALUE_TO_ECI; -std::map CharacterSetECI::NAME_TO_ECI; +std::map> CharacterSetECI::VALUE_TO_ECI; +std::map> CharacterSetECI::NAME_TO_ECI; const bool CharacterSetECI::inited = CharacterSetECI::init_tables(); @@ -72,11 +72,12 @@ bool CharacterSetECI::init_tables() { CharacterSetECI::CharacterSetECI(int const* values, char const* const* names) : values_(values), names_(names) { + zxing::Ref this_ref(this); for(int const* values = values_; *values != -1; values++) { - VALUE_TO_ECI[*values] = this; + VALUE_TO_ECI[*values] = this_ref; } for(char const* const* names = names_; *names; names++) { - NAME_TO_ECI[string(*names)] = this; + NAME_TO_ECI[string(*names)] = this_ref; } } diff --git a/core/src/zxing/common/CharacterSetECI.h b/core/src/zxing/common/CharacterSetECI.h index 95ea86f..2bf8dc1 100644 --- a/core/src/zxing/common/CharacterSetECI.h +++ b/core/src/zxing/common/CharacterSetECI.h @@ -25,10 +25,10 @@ namespace zxing { namespace common { -class CharacterSetECI { +class CharacterSetECI : public Counted { private: - static std::map VALUE_TO_ECI; - static std::map NAME_TO_ECI; + static std::map> VALUE_TO_ECI; + static std::map> NAME_TO_ECI; static const bool inited; static bool init_tables();