Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 28, 2011, 5:05:02 AM (14 years ago)
Author:
rgrieder
Message:

Fixing leaks:

  • Loading a level and then unloading it doesn't destroy the Namespace objects —> unload everything while compiling the level list
  • Delete duplicate LevelInfoItems instead of dropping them
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/src/orxonox/LevelManager.cc

    r7998 r7999  
    268268
    269269                // We don't need the loaded stuff anymore
    270                 Loader::unload(&file, mask);
     270                Loader::unload(&file);
    271271
    272272                if(info == NULL)
     
    279279                // Warn about multiple items so that it gets fixed quickly
    280280                if(availableLevels_.find(info) != availableLevels_.end())
     281                {
    281282                    COUT(2) << "Warning: Multiple levels with name '" << info->getName() << "' found!" << std::endl;
    282 
    283                 this->availableLevels_.insert(info);
     283                    // Delete LevelInfoItem to avoid a dangling pointer
     284                    delete info;
     285                }
     286                else
     287                    this->availableLevels_.insert(info);
    284288            }
    285289        }
Note: See TracChangeset for help on using the changeset viewer.