Don't implement your operator= that way. It is not exception safe.
Instead use the "copy and swap" idiom. It is much easier, is exception safe, and may solve whatever error you were getting....