summaryrefslogtreecommitdiff
path: root/TAO/tao/IIOP_ORB.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/IIOP_ORB.cpp')
-rw-r--r--TAO/tao/IIOP_ORB.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/TAO/tao/IIOP_ORB.cpp b/TAO/tao/IIOP_ORB.cpp
index fba16e00ddb..94dc771fd1d 100644
--- a/TAO/tao/IIOP_ORB.cpp
+++ b/TAO/tao/IIOP_ORB.cpp
@@ -275,11 +275,12 @@ iiop_string_to_object (CORBA::String string,
TAO_ServantBase *servant =
TAO_ORB_Core_instance ()->orb ()->_get_collocated_servant (data);
+ // This will increase the ref_count on data by one
CORBA_Object *obj = new CORBA_Object (data, servant, servant != 0);
- // Clean up in case of error
- if (obj == 0)
- data->Release ();
+ // Set the ref_count on data to 1, which is correct, because only
+ // obj has now a reference to it.
+ data->Release ();
return obj;
}