Skip to content

Commit

Permalink
EMI: Actually free _sortplanes and move the Sector constructior
Browse files Browse the repository at this point in the history
  • Loading branch information
klusark committed Jul 9, 2013
1 parent f2e1086 commit 3d74d6f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion engines/grim/sector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@

namespace Grim {

Sector::Sector(const Sector &other) {
Sector::Sector() : _vertices(NULL), _origVertices(NULL), _sortplanes(NULL),
_invalid(false), _shrinkRadius(0.f) {
}

Sector::Sector(const Sector &other) : _vertices(NULL), _origVertices(NULL), _sortplanes(NULL) {
*this = other;
}

Sector::~Sector() {
delete[] _vertices;
delete[] _origVertices;
delete[] _sortplanes;
}

void Sector::saveState(SaveGame *savedState) const {
Expand Down
2 changes: 1 addition & 1 deletion engines/grim/sector.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Sector {
HotType = 0x8000
};

Sector() : _vertices(NULL), _origVertices(NULL), _invalid(false), _shrinkRadius(0.f) {}
Sector();
Sector(const Sector &other);
virtual ~Sector();

Expand Down

0 comments on commit 3d74d6f

Please sign in to comment.