etch-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vei...@apache.org
Subject svn commit: r1578903 - /etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
Date Tue, 18 Mar 2014 13:58:41 GMT
Author: veithm
Date: Tue Mar 18 13:58:40 2014
New Revision: 1578903

URL: http://svn.apache.org/r1578903
Log:
Fixing memory leak in handling of void functions

Void functions are handled differently from non-void functions. In case of
void functions the resulting mailbox has not been deleted which caused
memory leaks.

Change-Id: I2e44dacc9d632df0d06cc32c6ac868de5c74720d

Modified:
    etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp

Modified: etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp
URL: http://svn.apache.org/viewvc/etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp?rev=1578903&r1=1578902&r2=1578903&view=diff
==============================================================================
--- etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp (original)
+++ etch/trunk/binding-cpp/runtime/src/main/transport/EtchDefaultDeliveryService.cpp Tue Mar
18 13:58:40 2014
@@ -179,8 +179,13 @@ status_t EtchDefaultDeliveryService::end
   status_t err = rmsg->get(field, &r);
   if (err == ETCH_ENOT_EXIST) {
     //void return value
-    mb->closeRead();
+    if (mb->closeRead() != ETCH_OK) {
+        ETCH_LOG_ERROR(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(),
"Error in end call on void function");
+        delete mbe;
+        return ETCH_ERROR;
+    }
     ETCH_LOG_DEBUG(mRuntime->getLogger(), mRuntime->getLogger().getDeliveryServiceContext(),
"End call for the message is completed");
+    delete mbe;
     return ETCH_OK;
   } else if (err != ETCH_OK) {
     mb->closeRead();



Mime
View raw message