You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/11/29 18:26:12 UTC

svn commit: r480634 - in /incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby: RubyServiceProxy.cpp RubyServiceWrapper.cpp

Author: jsdelfino
Date: Wed Nov 29 09:26:09 2006
New Revision: 480634

URL: http://svn.apache.org/viewvc?view=rev&rev=480634
Log:
Fixed a bug where we were setting into an Operation a pointer to a local variable  on the stack, causing a memory violation. Also fixed the formatting of two exception messages.

Modified:
    incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp
    incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp

Modified: incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp?view=diff&rev=480634&r1=480633&r2=480634
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceProxy.cpp Wed Nov 29 09:26:09 2006
@@ -36,6 +36,8 @@
 #include "tuscany/sca/ruby/model/RubyImplementation.h"
 #include "tuscany/sca/ruby/model/RubyReferenceBinding.h"
 
+#include <sstream>
+
 extern "C"
 {
     
@@ -233,7 +235,9 @@
                                 }
                                 if (dob != NULL)
                                 {
-                                    operation.addParameter(&dob);
+                                    DataObjectPtr* dataObjectData = new DataObjectPtr;
+                                    *dataObjectData = dob;
+                                    operation.addParameter(dataObjectData);
                                 }
                                 else
                                 {
@@ -345,8 +349,9 @@
                         }
                         default:
                         {
-                            string msg = "Operation parameter type not supported" + resultType;
-                            rb_raise(rb_eRuntimeError, msg.c_str());
+                            ostringstream msg;
+                            msg << "Operation parameter type not supported: " << resultType;
+                            rb_raise(rb_eRuntimeError, msg.str().c_str());
                             return Qnil;
                         }
                     }

Modified: incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp?view=diff&rev=480634&r1=480633&r2=480634
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/extensions/ruby/src/tuscany/sca/ruby/RubyServiceWrapper.cpp Wed Nov 29 09:26:09 2006
@@ -265,8 +265,9 @@
                                 }
                                 default:
                                 {
-                                    string msg = "Operation parameter type not supported" + parmType;
-                                    throwException(ServiceDataException, msg.c_str());
+                                    ostringstream msg;
+                                    msg << "Operation parameter type not supported: " << parmType;
+                                    throwException(ServiceDataException, msg.str().c_str());
                                 }
                             }
                             



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