title: Implementing b2ContactListener issue (box2d)
body: <p>I was reading the box2d manual and I saw that inter-frame contacts could only be picked up using b2ContactListener.</p>
  
  <p>I created a class ActorListener (all active world objects are actors)</p>
  
  <pre><code>class ActorListener : public b2ContactListener
  { 
      public :
      ActorListener();
      ~ActorListener();
  
      virtual void BeginContact(b2Contact* contact);
      virtual void EndContact(b2Contact* contact);
      virtual void PreSolve(b2Contact* contact, const b2Manifold* oldManifold);    
      virtual void PostSolve(b2Contact* contact, const b2ContactImpulse* impulse);
  };
  </code></pre>
  
  <p>And added it to my world when the game is initializing:</p>
  
  <pre><code>    Listener = new ActorListener();
      world-&gt;SetContactListener(Listener);
  </code></pre>
  
  <p>But as soon as an there is a collision I get an error in b2Contact.cpp</p>
  
  <pre><code>    if (wasTouching == false &amp;&amp; touching == true &amp;&amp; listener)
  {
      listener-&gt;BeginContact(this); //EXC_BAD_ACCESS
  }
  </code></pre>
  
  <p>Any ideas? Am I doing it wrong?</p>