[pytango] 89/483: Fixes #3463377

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


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

sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.

commit 271f2658b76c2e71b674fae941e55f99bc64c448
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Wed Dec 21 14:04:34 2011 +0000

    Fixes #3463377
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@18776 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 PyTango/release.py             |  2 +-
 doc/revision.rst               |  8 ++++++++
 src/device_attribute.cpp       | 20 +++++++++-----------
 src/device_attribute_numpy.hpp |  3 ---
 4 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/PyTango/release.py b/PyTango/release.py
index ba66bbe..77cf13c 100644
--- a/PyTango/release.py
+++ b/PyTango/release.py
@@ -47,7 +47,7 @@ class Release:
             - keywords : (seq<str>) list of keywords
             - license : (str) the license"""
     name = 'PyTango'
-    version_info = (7, 2, 2, 'dev', 0)
+    version_info = (7, 2, 3, 'dev', 0)
     version = '.'.join(map(str, version_info[:3]))
     version_long = version + ''.join(map(str, version_info[3:]))
     version_description = 'This version implements the C++ Tango 7.2 API.'
diff --git a/doc/revision.rst b/doc/revision.rst
index bd069c2..61f2a88 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -63,6 +63,8 @@ History of modifications:
 +----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
 | 12/12/11 | `8.12 <http://www.tango-controls.org/static/PyTango/v722/doc/html/index.html>`_  | Update to PyTango 7.2.2                             | T\. Coutinho          |
 +----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
+| --/--/12 | `8.13 <http://www.tango-controls.org/static/PyTango/v723/doc/html/index.html>`_  | Update to PyTango 7.2.3                             | T\. Coutinho          |
++----------+----------------------------------------------------------------------------------+-----------------------------------------------------+-----------------------+
 
 .. _version-history:
 
@@ -72,6 +74,12 @@ Version history
 +------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | version    | Changes                                                                                                                                                                      |
 +============+==============================================================================================================================================================================+
+| 7.2.3      | Features:                                                                                                                                                                    |
+|            |     - from sourceforge:                                                                                                                                                      |
+|            | Bug fixes:                                                                                                                                                                   |
+|            |     - from sourceforge:                                                                                                                                                      |
+|            |         - `3463377: PyTango memory leak in read encoded attribute <https://sourceforge.net/tracker/?func=detail&aid=3463377&group_id=57612&atid=484769>`_                    |
++------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | 7.2.2      | Features:                                                                                                                                                                    |
 |            |     - from sourceforge:                                                                                                                                                      |
 |            |         - `3305251: DS dynamic attributes discards some Attr properties <https://sourceforge.net/tracker/?func=detail&aid=3305251&group_id=57612&atid=484769>`_              |
diff --git a/src/device_attribute.cpp b/src/device_attribute.cpp
index d322c8c..55c7445 100644
--- a/src/device_attribute.cpp
+++ b/src/device_attribute.cpp
@@ -120,12 +120,11 @@ namespace PyDeviceAttribute {
         
         Tango::DevEncoded* buffer = value->get_buffer();
         
-        using namespace boost::python;
-        str encoded_format(buffer[0].encoded_format);
-        str encoded_data((const char*)buffer[0].encoded_data.get_buffer(),
-                          buffer[0].encoded_data.length());
+        boost::python::str encoded_format(buffer[0].encoded_format);
+        boost::python::str encoded_data((const char*)buffer[0].encoded_data.get_buffer(),
+                                        buffer[0].encoded_data.length());
         
-		py_value.attr(value_attr_name) = boost::python::make_tuple(encoded_format, encoded_data);
+        py_value.attr(value_attr_name) = boost::python::make_tuple(encoded_format, encoded_data);
 
         if (self.get_written_dim_x() > 0) {
             bool is_write_type = self.get_written_dim_x() && (value->length() < 2);
@@ -176,15 +175,14 @@ namespace PyDeviceAttribute {
         
         Tango::DevEncoded* buffer = value->get_buffer();
         
-        using namespace boost::python;
-        str r_encoded_format(buffer[0].encoded_format);
-
+        boost::python::str r_encoded_format(buffer[0].encoded_format);
+        
         Tango::DevVarCharArray &encReadBuffer = buffer[0].encoded_data;
         Py_ssize_t size = encReadBuffer.length();
-        CORBA::Octet *rawReadBuffer = encReadBuffer.get_buffer(1);
-        
-        PyObject *readArray = PyBuffer_FromReadWriteMemory(rawReadBuffer, size);
         
+        char *rawReadBuffer = (char *)encReadBuffer.get_buffer();
+        PyObject *readArray = PyString_FromStringAndSize(rawReadBuffer, size);
+
         object r_encoded_data = object(handle<>(readArray));
         
         py_value.attr(value_attr_name) = boost::python::make_tuple(r_encoded_format, r_encoded_data);
diff --git a/src/device_attribute_numpy.hpp b/src/device_attribute_numpy.hpp
index 7e275b6..90eeb92 100644
--- a/src/device_attribute_numpy.hpp
+++ b/src/device_attribute_numpy.hpp
@@ -27,9 +27,6 @@
 
 #pragma once
 
-// Because of line: object iter_guard(handle<>(iter));
-#pragma warning(disable:4930)
-
 namespace PyDeviceAttribute {
 
     /// This callback is run to delete Tango::DevVarXArray* objects.

-- 
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