Heap corruption when deleting class instance of another class
<p>(c++ class issue)</p>

<p>This is really getting me down,when ever the following class deletes its member pointer (to class player) in it's destructor I get a 'Heap corruption after normal block' error.</p>

<pre><code>//Team.h
class Team
{
public:
    Team (const char* team_dir_path);
    ~Team(void);

    Team (const Team &amp;team);

    Player* player;
    int player_cnt;
};

//Team.cpp

Team::Team( const char* team_dir_path )
{
    player = 0;
    player_cnt = 0;

    std::string* name;
    int* body;
    int* mind;
    int* speed;
    int* health;
    int* item;

    std::ifstream infile;
    infile.open( team_dir_path );
    if (infile.is_open())
    {
     infile &gt;&gt; player_cnt;

     if (player_cnt)
     {
      name = new std::string [player_cnt];
      body = new int [player_cnt];
      mind = new int [player_cnt];
      speed = new int [player_cnt];
      health = new int [player_cnt];
      item = new int [player_cnt];

      player = new Player[ player_cnt];


      for (int i=0; i&lt;player_cnt; i++)
      {
       infile &gt;&gt; name[i] &gt;&gt; body[i] &gt;&gt; mind[i]
           &gt;&gt; speed[i] &gt;&gt; health[i] &gt;&gt; item[i];
      }

      infile.close();

      for (int i=0; i&lt;player_cnt; i++)

      {
       player[i].name = name[i];
       player[i].set_stat( BODY, body[i] );
       player[i].set_stat( MIND, mind[i] );
       player[i].set_stat( SPEED, speed[i] );
       player[i].set_stat( HEALTH, health[i] );
       player[i].set_stat( ITEM, item[i] );
      }

      delete [] name;
      delete [] body;
      delete [] mind;
      delete [] speed;
      delete [] health;
      delete [] item;
     }
    }
}

Team::~Team(void)
{
    if (player){ delete [] player;}
}

Team::Team (const Team &amp;team)
{
    this -&gt; player = new Player;
    this -&gt; player_cnt = 0;
}

//Player.h
class Player
{
public:
    Player(void);
    ~Player(void);

    void set_stat (const int which, const int value){ stat[which] = value;}
    void assign_stat (const int which, const int value){ stat[which] += value;}
    int get_stat (const int which){ return stat[which];}

    std::string name;

private:    

    // BODY;MIND;SPEED;HEALTH;ITEM.

    int stat[ MAXSTAT ];
};

//Player.cpp
Player::Player(void)
{
}

Player::~Player(void)
{
}

// Main.cpp
int main()
{
    initscr();
    cbreak();
    noecho();  

    Team* team1 = 0;
    Team* team2 = 0;

    team1 = new Team("c:\\IB\\ib\\teams\\bombers.txt");
    team2 = new Team("c:\\IB\\ib\\teams\\maruaders.txt");

    refresh();
    napms(1000);

    if (team1){ delete team1;}
    if (team2){ delete team2;}

    endwin();
}
</code></pre>

<p>So whenever ...</p>

<pre><code>if (player){ delete [] player;}
</code></pre>

<p>is reached in class Team destructor I get the heap corruption error.</p>

<p>Please help.</p>
