]> pilppa.com Git - libplpbus.git/commitdiff
memory leak fix
authorMika Laitio <lamikr@pilppa.org>
Fri, 3 Aug 2012 15:46:52 +0000 (18:46 +0300)
committerMika Laitio <lamikr@pilppa.org>
Fri, 3 Aug 2012 15:46:52 +0000 (18:46 +0300)
added  call to
orb->destroy() on OrbServerImpl destroctor.

Signed-off-by: Mika Laitio <lamikr@pilppa.org>
src/plpbus/OrbServerImpl.cc

index 1207f912c31d3900d8a78cf13a0dfcee8b22097a..c22e3de930ee8259de046b14c05915c6118741a6 100644 (file)
@@ -30,6 +30,7 @@ OrbServerImpl::OrbServerImpl()
 
 OrbServerImpl::~OrbServerImpl()
 {
+       _orb->destroy();
        log_info("done\n");
 }
 
@@ -278,12 +279,12 @@ CosNaming::NamingContext_var OrbServerImpl::get_naming_service_context(const cha
        ret_val = NULL;
        try {
                // get nameservice reference
-               log_debug("started\n");
-               ns_obj  = _orb->resolve_initial_references(CONST_NAME_SERVICE_NAME);
+               //log_debug("started\n");
+               ns_obj  = _orb->resolve_initial_references("NameService");
                if (CORBA::is_nil(ns_obj) == false) {
                        // get naming service context
-                       ns_cntx = CosNaming::NamingContext::_narrow(ns_obj);
-                       if (CORBA::is_nil(ns_cntx) == false) {
+                       ns_cntx = CosNaming::NamingContext::_narrow(ns_obj.in());
+                       if (CORBA::is_nil(ns_cntx.in()) == false) {
                                cntx_dta.length(1);
                                cntx_dta[0].id          = CORBA::string_dup(service_name_param);
                                cntx_dta[0].kind        = CORBA::string_dup(service_kind_param);
@@ -311,6 +312,7 @@ CosNaming::NamingContext_var OrbServerImpl::get_naming_service_context(const cha
                                catch(CosNaming::NamingContext::AlreadyBound& ex) {
                                        log_error("Failed to get naming service context for %s. Context with same name already exist.\n", service_name_param);
                                }
+                               //CORBA::release(ns_cntx);
                        }
                        else {
                                log_error("Failed to get naming service context for %s. Could not narrow the name service.\n", service_name_param);
@@ -338,7 +340,7 @@ CosNaming::NamingContext_var OrbServerImpl::get_naming_service_context(const cha
        catch(CORBA::SystemException& ex) {
                log_error("Failed to get naming service context for %s, system error.\n", service_name_param);
        }
-       log_debug("done\n");
+       //log_debug("done\n");
        return ret_val;
 }