[pytango] 16/483: fixes #3286055

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:20 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 cc17c85fdfa6339c743c808bd10a61ddce3de0c0
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Wed Apr 13 16:09:59 2011 +0000

    fixes #3286055
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@16559 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 Makefile                    | 21 +++++++++------------
 doc/revision.rst            |  1 +
 src/server/device_class.cpp |  5 -----
 src/server/device_impl.cpp  | 38 ++------------------------------------
 src/server/device_impl.h    | 28 ----------------------------
 5 files changed, 12 insertions(+), 81 deletions(-)

diff --git a/Makefile b/Makefile
index 35cfd59..85e1863 100644
--- a/Makefile
+++ b/Makefile
@@ -52,13 +52,14 @@ prefix=$(_PY_DIR)/site-packages
 endif
 endif
 
-
 SRC_DIR = src
+
+ifndef OBJS_DIR
 OBJS_DIR = objs
+endif
 
 CC = gcc
 CCFLAGS = -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC $(INCLUDE_DIRS)
-CCOPTS = -include$(SRC_DIR)/precompiled_header.hpp
 
 LN = g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
 LN_VER = -Wl,-h -Wl,--strip-all
@@ -76,7 +77,6 @@ $(TANGO_INC)/tango \
 $(PY_INC) \
 $(NUMPY_INC)
 
-PREP = $(SRC_DIR)/precompiled_header.hpp
 LIBNAME = _PyTango.so
 
 OBJS = \
@@ -160,10 +160,10 @@ device_impl.h
 
 all: build
 
-build: $(PREP).gch $(LIBNAME)
+build: init $(LIBNAME)
 
-$(PREP).gch: $(PREP)
-	$(CC) $(CCFLAGS) -c $< -o $(PREP).gch
+init:
+	mkdir -p $(OBJS_DIR)
 
 #
 # Rule for shared library
@@ -177,12 +177,10 @@ $(PREP).gch: $(PREP)
 # Rule for API files
 #
 $(OBJS_DIR)/%.o: $(SRC_DIR)/%.cpp
-	mkdir -p $(OBJS_DIR)
-	$(CC) $(CCFLAGS) -c $< -o $(OBJS_DIR)/$*.o $(CCOPTS)
+	$(CC) $(CCFLAGS) -c $< -o $(OBJS_DIR)/$*.o
 
 $(OBJS_DIR)/%.o: $(SRC_DIR)/server/%.cpp
-	mkdir -p $(OBJS_DIR)
-	$(CC) $(CCFLAGS) -c $< -o $(OBJS_DIR)/$*.o $(CCOPTS)
+	$(CC) $(CCFLAGS) -c $< -o $(OBJS_DIR)/$*.o
 
 #
 #	The shared libs
@@ -193,9 +191,8 @@ $(LIBNAME): $(OBJS)
 
 clean:
 	rm -f *.o core
-	rm -f $(OBJS_DIR)/*.o
-	rm -f $(OBJS_DIR)/*.so
 	rm -f $(PREP).gch
+	rm -rf $(OBJS_DIR)
 
 install: build
 	rsync -r PyTango $(prefix)
diff --git a/doc/revision.rst b/doc/revision.rst
index 3224314..8769475 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -74,6 +74,7 @@ Version history
 |            |         - 3284434: [pytango][doc] few ERROR during the doc generation               |
 |            |         - 3284435: [pytango][doc] few warning during the doc generation             |
 |            |         - 3284440: [pytango][spock] the profile can't be installed                  |
+|            |         - 3286055: PyTango 7.1.x DS using Tango C++ 7.2.x seg faults on exit        |
 +------------+-------------------------------------------------------------------------------------+
 | 7.1.4      | Features:                                                                           |
 |            |     - from sourceforge:                                                             |
diff --git a/src/server/device_class.cpp b/src/server/device_class.cpp
index b4b4c25..3995308 100644
--- a/src/server/device_class.cpp
+++ b/src/server/device_class.cpp
@@ -173,10 +173,6 @@ CppDeviceClassWrap::~CppDeviceClassWrap()
 void CppDeviceClassWrap::init_class()
 {
     AutoPythonGIL python_guard;
-    
-    //@TODO remove this line when Tango C++ is cleaned up
-    //set_py_class(true);
-
     signal_handler_defined = is_method_defined(m_self, "signal_handler");
 }
 
@@ -345,7 +341,6 @@ void export_device_class()
         .def("_device_destroyer",
             (void (Tango::DeviceClass::*) (const char *))
             &Tango::DeviceClass::device_destroyer)
-        .def("is_py_class", &Tango::DeviceClass::is_py_class)
         .def("_create_attribute", &CppDeviceClass::create_attribute)
         .def("_create_command", &CppDeviceClass::create_command)
     ;
diff --git a/src/server/device_impl.cpp b/src/server/device_impl.cpp
index 699637c..7a5f1af 100644
--- a/src/server/device_impl.cpp
+++ b/src/server/device_impl.cpp
@@ -680,7 +680,7 @@ PyDeviceImplBase::~PyDeviceImplBase()
 
 void PyDeviceImplBase::py_delete_dev()
 {}
-
+ 
 Device_3ImplWrap::Device_3ImplWrap(PyObject *self, CppDeviceClass *cl,
                                    std::string &st)
     :Tango::Device_3Impl(cl,st),
@@ -705,15 +705,6 @@ void Device_3ImplWrap::_init()
     // Make sure the wrapper contains a valid pointer to the self
     // I found out this is needed by inspecting the boost wrapper_base.hpp code
     initialize_wrapper(the_self, this);
-
-    // Tell Tango that this is a Python device.
-    // Humm, we should try to avoid this in the future
-    this->set_py_device(true);
-
-    Tango::Device_3ImplExt *tmp_ptr = ext_3;
-    Py_Device_3ImplExt *new_ext = new Py_Device_3ImplExt(this);
-    ext_3 = new_ext;
-    delete tmp_ptr;
 }
 
 void Device_3ImplWrap::init_device()
@@ -869,22 +860,13 @@ Device_4ImplWrap::Device_4ImplWrap(PyObject *self, CppDeviceClass *cl,
 }
 
 Device_4ImplWrap::~Device_4ImplWrap()
-{}
+{ delete_device(); }
 
 void Device_4ImplWrap::_init()
 {
     // Make sure the wrapper contains a valid pointer to the self
     // I found out this is needed by inspecting the boost wrapper_base.hpp code
     initialize_wrapper(the_self, this);
-
-    // Tell Tango that this is a Python device.
-    // Humm, we should try to avoid this in the future
-    this->set_py_device(true);
-
-    Tango::Device_3ImplExt *tmp_ptr = ext_3;
-    Py_Device_3ImplExt *new_ext = new Py_Device_3ImplExt(this);
-    ext_3 = new_ext;
-    delete tmp_ptr;
 }
 
 void Device_4ImplWrap::init_device()
@@ -1012,22 +994,6 @@ void Device_4ImplWrap::default_signal_handler(long signo)
     this->Tango::Device_4Impl::signal_handler(signo);
 }
 
-///////////////////////////////////////////////////////////////////////////////
-// Ext
-///////////////////////////////////////////////////////////////////////////////
-
-Py_Device_3ImplExt::Py_Device_3ImplExt(PyDeviceImplBase *ptr)
-    :Tango::Device_3ImplExt(), my_dev(ptr)
-{}
-
-Py_Device_3ImplExt::~Py_Device_3ImplExt()
-{}
-
-void Py_Device_3ImplExt::delete_dev()
-{
-    my_dev->py_delete_dev();
-}
-
 #if ((defined sun) || (defined WIN32))
 BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS(register_signal_overload,
                                        Tango::DeviceImpl::register_signal, 1, 1)
diff --git a/src/server/device_impl.h b/src/server/device_impl.h
index b327489..69452d7 100644
--- a/src/server/device_impl.h
+++ b/src/server/device_impl.h
@@ -419,32 +419,4 @@ protected:
     void _init();
 };
 
-/**
- * Device_3Impl extension wrapper
- */
-class Py_Device_3ImplExt:public Tango::Device_3ImplExt
-{
-public:
-    /** pointer to pytango wrapper */
-    PyDeviceImplBase *my_dev;
-
-    /**
-     * Constructor
-     *
-     * @param[in] ptr Device_4Impl wrapper pointer
-     */
-    Py_Device_3ImplExt(PyDeviceImplBase *ptr);
-
-    /**
-     * Destructor
-     */
-    virtual ~Py_Device_3ImplExt();
-
-    /**
-     * overwrite of delete_dev method
-     */
-    virtual void delete_dev();
-
-};
-
 #endif // _DEVICE_IMPL_H

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