Memory Leaks and Class Attributes
<p>I've been writing a game and I remember in a previous coop I was working on a video decoder that would crash after 5 minutes of usage because there was no memory left. </p>

<p>My boss spent all day trying to fix it and came back to see me the next day a little pissed cause he told me I did not put every class member attribute in the constructor's initializer list. </p>

<p>It was an int or maybe some other data/primitive. Now I thought stuff in a class was initialized with a default value instead of being affected by whatever lingered at the adress. I never really thought of asking this question until now that I am doing the same so I wanted to clarify this.</p>

<p>Let's say I do :</p>

<pre><code>#pragma once
#include "GameState.h"
#include "GameGrid.h"

class Shape;

class PlayState : public GameState
{

....

private:
sf::Clock _keyPressClock;

Shape *_droppingShape;
int generateShapeID();
int generateHorizSpawnPos();
};
</code></pre>

<p>If all my constructor initializes is the pointer :</p>

<pre><code>PlayState::PlayState() : _droppingShape(NULL) {}
</code></pre>

<p>Is that bad practice or can indeed cause a memory leak?</p>
