summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-11-03 16:17:50 +0100
committerLuboš Luňák <l.lunak@suse.cz>2012-11-03 16:18:30 +0100
commitd32878608ecfdeceaddb266ac69198ef69b62c12 (patch)
treea2b8576b764b21e4c9673219e4fc6584c1e26b6e /connectivity
parent155f09b32f71e15c7c322e7a8f3452be9310f69f (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.cxx12
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)