diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-11-03 16:17:50 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-11-03 16:18:30 +0100 |
commit | d32878608ecfdeceaddb266ac69198ef69b62c12 (patch) | |
tree | a2b8576b764b21e4c9673219e4fc6584c1e26b6e /connectivity | |
parent | Define gb_CPPU_ENV befire use (diff) | |
download | core-d32878608ecfdeceaddb266ac69198ef69b62c12.tar.gz core-d32878608ecfdeceaddb266ac69198ef69b62c12.zip |
fix copy ctor
Using operator= in a copy ctor is a rather bad idea when the operator= accesses
uninitialized data members.
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/ado/Awrapado.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx index e7608747edce..08535858cf55 100644 --- a/connectivity/source/drivers/ado/Awrapado.cxx +++ b/connectivity/source/drivers/ado/Awrapado.cxx @@ -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) |