[Libreoffice-commits] .: connectivity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sat Nov 3 08:19:38 PDT 2012
connectivity/source/drivers/ado/Awrapado.cxx | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
New commits:
commit d32878608ecfdeceaddb266ac69198ef69b62c12
Author: LuboÅ¡ LuÅák <l.lunak at suse.cz>
Date: Sat Nov 3 16:17:50 2012 +0100
fix copy ctor
Using operator= in a copy ctor is a rather bad idea when the operator= accesses
uninitialized data members.
diff --git a/connectivity/source/drivers/ado/Awrapado.cxx b/connectivity/source/drivers/ado/Awrapado.cxx
index e760874..0853585 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)
More information about the Libreoffice-commits
mailing list