From d32878608ecfdeceaddb266ac69198ef69b62c12 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Sat, 3 Nov 2012 16:17:50 +0100 Subject: fix copy ctor Using operator= in a copy ctor is a rather bad idea when the operator= accesses uninitialized data members. --- connectivity/source/drivers/ado/Awrapado.cxx | 12 +++++++----- 1 file 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) -- cgit v1.2.3