title: Should objects delete themselves in C++?
body: <p>I've spent the last 4 years in C# so I'm interested in current best practices and common design patterns in C++.  Consider the following partial example:</p>
  
  <pre><code>class World
  {
  public:
      void Add(Object *object);
      void Remove(Object *object);
      void Update();
  }
  
  class Fire : Object
  {
  public:
      virtual void Update()
      {
          if(age &gt; burnTime)
          {
              world.Remove(this);
              delete this;
          }
      }
  }
  </code></pre>
  
  <p>Here we have a world responsible for managing a set of objects and updating them regularly.  Fire is an an object that might be added to the world under many different circumstances but typically by another object already in the world.  Fire is the only object that knows when it has burned out so currently I have it deleting itself.  The object that created the fire is likely no longer in existence or relevant.</p>
  
  <p>Is this a sensible thing to do or is there a better design that would help clean up these objects?</p>