You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by aj...@apache.org on 2007/02/28 15:48:58 UTC

svn commit: r512777 - /incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp

Author: ajborley
Date: Wed Feb 28 06:48:57 2007
New Revision: 512777

URL: http://svn.apache.org/viewvc?view=rev&rev=512777
Log:
Fixed (another) bug for ElementTree handling in Python extension

Modified:
    incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp

Modified: incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp?view=diff&rev=512777&r1=512776&r2=512777
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp Wed Feb 28 06:48:57 2007
@@ -816,9 +816,6 @@
                                     PyObject* pElemString = PyObject_CallFunction(elementTreeToStringFunc, "O", pValue);
                                     char* data = PyString_AsString(pElemString);
 
-                                    Py_DECREF(elementTreeToStringFunc);
-                                    Py_DECREF(pElemString);
-
                                     loginfo("Converting Python ElementTree to SDO DataObject: %s", data);
 
                                     Composite* composite = component->getComposite();                                   
@@ -833,6 +830,7 @@
                                     {
                                         *dataObjectData = NULL;
                                     }
+
                                     if (*dataObjectData != NULL)
                                     {
                                         operation.setReturnValue(dataObjectData);
@@ -841,7 +839,10 @@
                                     {
                                         string msg = "xml.etree.ElementTree.Element could not be converted to a DataObject";
                                         throwException(ServiceDataException, msg.c_str());
-                                    }                                    
+                                    }
+
+                                    Py_DECREF(elementTreeToStringFunc);
+                                    Py_DECREF(pElemString);
                                 }
                                 else
                                 {



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org