[pytango] 22/26: Fix memory leak: since tango C++ 8.0 the behavior of constructor changed.

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:16:15 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to annotated tag v8.1.8
in repository pytango.

commit e54198afc1ad2daa981da4a05ab82d6ed551d69e
Author: Jose Tiago Coutinho Macara <coutinho at esrf.fr>
Date:   Mon Nov 2 07:56:37 2015 +0100

    Fix memory leak: since tango C++ 8.0 the behavior of constructor changed.
---
 src/boost/cpp/callback.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/boost/cpp/callback.cpp b/src/boost/cpp/callback.cpp
index ce083d4..06ceaef 100644
--- a/src/boost/cpp/callback.cpp
+++ b/src/boost/cpp/callback.cpp
@@ -272,7 +272,8 @@ void PyCallBackPushEvent::fill_py_event(Tango::EventData* ev, object & py_ev, ob
     // attr_value pointer but its own copy, so my efforts are useless.
     if (ev->attr_value)
     {
-        Tango::DeviceAttribute *attr = new Tango::DeviceAttribute(*ev->attr_value);
+        Tango::DeviceAttribute *attr = new Tango::DeviceAttribute;
+	(*attr) = std::move(*ev->attr_value);
         py_ev.attr("attr_value") = PyDeviceAttribute::convert_to_python(attr, *ev->device, extract_as);
     }
     // ev->attr_value = 0; // Do not delete, python will.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list