c ++ – Calling the destructor when replacing an object

I have a variable that contains an object. Now, I assign a different object to this variable. Will the original object be destroyed and when?
Example of function:

{
myclass a ();
myclass b (); // create 2 objects
a = b; // copy b
} // leave the scope, both copies of b will be destroyed