title: Destructor called after operator= in c++
body: <p>I have a class whose members are somewhat as follows</p>
  
  <pre><code>CRectangle CRectangle::operator+ (CRectangle param) {
      CRectangle temp;
      temp.width = new int;
      temp.height = new int;
      *temp.width = *width + *param.width;
      *temp.height = *height + *param.height;
      return (temp);
  }
  
  CRectangle&amp; CRectangle::operator= (CRectangle param) {
      *width =  *param.width;
      *height = *param.height;
      return *this;
  }
  
  CRectangle::~CRectangle () {
      n--;
      delete width;
      delete height;
  }
  </code></pre>
  
  <p>Now if i do</p>
  
  <pre><code>CRectangle a(3, 4), b(5, 6), c;
  cout &lt;&lt; b.area() &lt;&lt; endl; // gives 30
  c = a + b;
  cout &lt;&lt; b.area() &lt;&lt; endl; // gives random value
  </code></pre>
  
  <p>then destructor is called on object <code>b</code> too. I mean, it should be called on temp, but why on <code>b</code>?
  Is this related to how i am passing the parameters?</p>