diff --git a/src/config/favorite_status.cpp b/src/config/favorite_status.cpp index 85240cb202..3426f2c580 100644 --- a/src/config/favorite_status.cpp +++ b/src/config/favorite_status.cpp @@ -59,13 +59,7 @@ FavoriteStatus::FavoriteStatus(const XMLNode* node, std::string parse_type) m_favorite[temp_group_string].insert(temp_string); } } -} // FavoriteStatus - -//------------------------------------------------------------------------------ -FavoriteStatus::~FavoriteStatus() -{ - -} // ~FavoriteStatus +} // FavoriteStatu //------------------------------------------------------------------------------ /** Adds a new favorite track to this player profile and to the group diff --git a/src/config/favorite_status.hpp b/src/config/favorite_status.hpp index 522ae3dd55..cde113b1bc 100644 --- a/src/config/favorite_status.hpp +++ b/src/config/favorite_status.hpp @@ -55,8 +55,6 @@ class FavoriteStatus /** Parse all <(parse_type)/> in in xml node */ FavoriteStatus(const XMLNode *node, std::string parse_type); - virtual ~FavoriteStatus(); - void save(UTFWriter &out); bool isFavorite(std::string ident); diff --git a/src/config/player_profile.cpp b/src/config/player_profile.cpp index e2d1aa9f73..8a4a8ee13a 100644 --- a/src/config/player_profile.cpp +++ b/src/config/player_profile.cpp @@ -105,9 +105,22 @@ PlayerProfile::PlayerProfile(const XMLNode* node) //------------------------------------------------------------------------------ PlayerProfile::~PlayerProfile() { - delete m_story_mode_status; - delete m_achievements_status; - delete m_favorite_track_status; + if (m_story_mode_status) + { + delete m_story_mode_status; + } + if (m_achievements_status) + { + delete m_achievements_status; + } + if (m_favorite_track_status) + { + delete m_favorite_track_status; + } + if (m_favorite_kart_status) + { + delete m_favorite_kart_status; + } #ifdef DEBUG m_magic_number = 0xDEADBEEF; #endif