Skip to content

Commit

Permalink
GUI: Use PtrMap in the GUI classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 29, 2016
1 parent 1667fdd commit da68283
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
7 changes: 0 additions & 7 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,7 @@ void MainWindow::close() {
_files.clear();
_path.clear();

for (ArchiveMap::iterator a = _archives.begin(); a != _archives.end(); ++a)
delete a->second;

_archives.clear();

for (KEYDataFileMap::iterator d = _keyDataFiles.begin(); d != _keyDataFiles.end(); ++d)
delete d->second;

_keyDataFiles.clear();

resourceSelect(0);
Expand Down
5 changes: 3 additions & 2 deletions src/gui/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

#include <wx/frame.h>

#include "src/common/ptrmap.h"
#include "src/common/ustring.h"
#include "src/common/filetree.h"

Expand Down Expand Up @@ -74,8 +75,8 @@ class MainWindow : public wxFrame {
Aurora::Archive *getArchive(const boost::filesystem::path &path);

private:
typedef std::map<Common::UString, Aurora::Archive *> ArchiveMap;
typedef std::map<Common::UString, Aurora::KEYDataFile *> KEYDataFileMap;
typedef Common::PtrMap<Common::UString, Aurora::Archive> ArchiveMap;
typedef Common::PtrMap<Common::UString, Aurora::KEYDataFile> KEYDataFileMap;

Common::UString _path;
Common::FileTree _files;
Expand Down

0 comments on commit da68283

Please sign in to comment.