fixed agent crash when executing action with output
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 12 Jul 2016 10:52:57 +0000 (13:52 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 12 Jul 2016 10:52:57 +0000 (13:52 +0300)
src/agent/core/actions.cpp
src/java/netxms-eclipse/ObjectManager/src/org/netxms/ui/eclipse/objectmanager/actions/DeleteObject.java

index 425eca3..ed84c40 100644 (file)
@@ -157,11 +157,13 @@ public:
       m_cmdLine = _tcsdup(cmd);
       m_args = args;
       m_session = session;
+      m_session->incRefCount();
       m_requestId = requestId;
    }
 
    ~ActionExecutorData()
    {
+      m_session->decRefCount();
       free(m_cmdLine);
       delete m_args;
    }
index 1ac5231..6cad9e6 100644 (file)
@@ -61,7 +61,7 @@ public class DeleteObject extends AbstractHandler
       }
       boolean confirmed = MessageDialogHelper.openConfirm(window.getShell(), Messages.get().DeleteObject_ConfirmDelete, question);
       
-      if(confirmed)
+      if (confirmed)
       {
          final Object[] objects = ((IStructuredSelection)selection).toArray();
          final NXCSession session = (NXCSession)ConsoleSharedData.getSession();