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 | 155f09b32f71e15c7c322e7a8f3452be9310f69f (diff) |
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) |