[lmiwbem/f20] fix CIMInstance::getitem() return value by reference

Peter Hatina phatina at fedoraproject.org
Wed Aug 27 07:47:17 UTC 2014


commit 65c363995cb11976bac4be47af89671ecc3612ae
Author: Peter Hatina <phatina at redhat.com>
Date:   Wed Aug 27 09:32:28 2014 +0200

    fix CIMInstance::getitem() return value by reference

 lmiwbem-07-instance-property-by-ref.patch |   23 +++++++++++++++++++++++
 lmiwbem.spec                              |    7 ++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/lmiwbem-07-instance-property-by-ref.patch b/lmiwbem-07-instance-property-by-ref.patch
new file mode 100644
index 0000000..081beca
--- /dev/null
+++ b/lmiwbem-07-instance-property-by-ref.patch
@@ -0,0 +1,23 @@
+commit caf2a217b07920580afb98e34d1a42819016e5d7
+Author: Peter Hatina <phatina at redhat.com>
+Date:   Tue Aug 26 15:36:24 2014 +0200
+
+    fix CIMInstance::getitem() return value by reference
+
+diff --git a/src/lmiwbem_instance.cpp b/src/lmiwbem_instance.cpp
+index 2f453a8..f46543e 100644
+--- a/src/lmiwbem_instance.cpp
++++ b/src/lmiwbem_instance.cpp
+@@ -317,10 +317,10 @@ std::string CIMInstance::repr()
+ bp::object CIMInstance::getitem(const bp::object &key)
+ {
+     evalProperties();
+-    lmi::extract<CIMProperty> ext_property(m_properties[key]);
++    lmi::extract<CIMProperty&> ext_property(m_properties[key]);
+ 
+     if (ext_property.check())
+-        return static_cast<CIMProperty>(ext_property).getValue();
++        return static_cast<CIMProperty&>(ext_property).getValue();
+     return m_properties[key];
+ }
+ 
diff --git a/lmiwbem.spec b/lmiwbem.spec
index dd928a7..dc75947 100644
--- a/lmiwbem.spec
+++ b/lmiwbem.spec
@@ -1,6 +1,6 @@
 Name:           lmiwbem
 Version:        0.2.0
-Release:        9%{?dist}
+Release:        10%{?dist}
 Summary:        Python WBEM Client
 License:        LGPLv2+
 URL:            https://github.com/phatina/lmiwbem
@@ -11,6 +11,7 @@ Patch2:         lmiwbem-03-platform-support.patch
 Patch3:         lmiwbem-04-fix-gil-deadlocks.patch
 Patch4:         lmiwbem-05-fix-init.patch
 Patch5:         lmiwbem-06-listener-api-compat.patch
+Patch6:         lmiwbem-07-instance-property-by-ref.patch
 
 BuildRequires:  autoconf
 BuildRequires:  automake
@@ -46,6 +47,7 @@ Group:          Documentation
 %patch3 -p1 -b .fix-gil-deadlocks
 %patch4 -p1 -b .fix-init
 %patch5 -p1 -b .fix-listener-api-compat
+%patch6 -p1 -b .fix-instance-property-by-ref
 
 %build
 autoreconf -if
@@ -65,6 +67,9 @@ find %{buildroot} -name '*.la' | xargs rm -f
 %{_docdir}/%{name}-%{version}/html
 
 %changelog
+* Wed Aug 27 2014 Peter Hatina <phatina at redhat.com> - 0.2.0-10
+- fix CIMInstance::getitem() return value by reference
+
 * Thu Jul 31 2014 Peter Hatina <phatina at redhat.com> - 0.2.0-9
 - drop __all__ from lmiwbem.__init__.py
 


More information about the scm-commits mailing list