Kaydet (Commit) d3287860 authored tarafından Luboš Luňák's avatar Luboš Luňák

fix copy ctor

Using operator= in a copy ctor is a rather bad idea when the operator= accesses
uninitialized data members.
üst 155f09b3
......@@ -1561,6 +1561,13 @@ WpBase::WpBase(IDispatch* pInt)
}
}
WpBase::WpBase(const WpBase& aWrapper)
:pIUnknown(aWrapper.pIUnknown)
{
if (pIUnknown)
pIUnknown->AddRef();
}
//inline
WpBase& WpBase::operator=(const WpBase& rhs)
{
......@@ -1588,11 +1595,6 @@ WpBase& WpBase::operator=(IDispatch* rhs)
return *this;
}
WpBase::WpBase(const WpBase& aWrapper)
{
operator=(aWrapper);
}
WpBase::~WpBase()
{
if (pIUnknown)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment