The implementation of _bstr_t::Assign()
has been updated as mentioned by Igor Tandetnik in his comment.
Here's the implementation in VS2010 and it works as expected:
inline void _bstr_t::Assign(BSTR s)
{
_COM_ASSERT(s == NULL || m_Data == NULL || m_Data->GetWString() != s);
if (s == NULL || m_Data == NULL || m_Data->GetWString() != s)
{
_Free();
m_Data = new Data_t(s, TRUE);
if (m_Data == NULL) {
_com_issue_error(E_OUTOFMEMORY);
}
}
}