diff --git a/src/libcalamares/locale/TimeZone.cpp b/src/libcalamares/locale/TimeZone.cpp index ea77fc39e..ad09d82d5 100644 --- a/src/libcalamares/locale/TimeZone.cpp +++ b/src/libcalamares/locale/TimeZone.cpp @@ -130,10 +130,11 @@ TZRegion::~TZRegion() qDeleteAll( m_zones ); } -CStringPairList +const CStringPairList& TZRegion::fromZoneTab() { - return TZRegion::fromFile( TZ_DATA_FILE ); + static CStringPairList zoneTab = TZRegion::fromFile( TZ_DATA_FILE ); + return zoneTab; } CStringPairList diff --git a/src/libcalamares/locale/TimeZone.h b/src/libcalamares/locale/TimeZone.h index 19d0011b2..dd1f9714d 100644 --- a/src/libcalamares/locale/TimeZone.h +++ b/src/libcalamares/locale/TimeZone.h @@ -103,7 +103,7 @@ public: */ static CStringPairList fromFile( const char* fileName ); /// @brief Calls fromFile with the standard zone.tab name - static CStringPairList fromZoneTab(); + static const CStringPairList& fromZoneTab(); const CStringPairList& zones() const { return m_zones; }