예제 #1
0
파일: WmCoreOp.cs 프로젝트: tmbx/kwm-ng
 /// <summary>
 /// Cancel the KCD query specified and set its reference to null,
 /// if needed.
 /// </summary>
 protected void ClearKcdQuery(ref KcdQuery query)
 {
     if (query != null)
     {
         query.Terminate();
         query = null;
     }
 }
예제 #2
0
파일: Vnc.cs 프로젝트: tmbx/kwm-ng
        /// <summary>
        /// Clean up the state when the session has completed to avoid resource
        /// leaks. This object CANNOT be reused for another session since some
        /// recently cancelled threads may still reference the object and try
        /// to modify its state.
        /// </summary>
        private void Terminate()
        {
            Status = VncSessionStatus.Completed;
            AppVnc.SessionPresentFlag = false;
            App.LocalSession          = null;

            if (Overlay != null)
            {
                Overlay.Terminate();
                Overlay = null;
            }

            if (TicketQuery != null)
            {
                TicketQuery.Terminate();
                TicketQuery = null;
            }

            if (Tunnel != null)
            {
                Tunnel.Terminate();
                Tunnel = null;
            }

            if (TunnelThread != null)
            {
                TunnelThread.RequestCancellation();
                TunnelThread = null;
            }

            if (MainProcess != null)
            {
                MainProcess.Terminate();
                MainProcess = null;
            }

            if (DummyProcess != null)
            {
                DummyProcess.Terminate();
                DummyProcess = null;
            }

            if (Timer != null)
            {
                Timer.WakeMeUp(-1);
                Timer = null;
            }

            if (InactivityMonitor != null)
            {
                InactivityMonitor.Enabled = false;
                InactivityMonitor.Dispose();
                InactivityMonitor = null;
            }
        }
예제 #3
0
        /// <summary>
        /// Process an ANP reply received from the KCD.
        /// </summary>
        private static void ProcessKcdAnpReply(WmKcd kcd, AnpMsg msg)
        {
            // We have no knowledge of the query. Ignore the reply.
            if (!kcd.QueryMap.ContainsKey(msg.ID))
            {
                return;
            }

            // Retrieve and remove the query from the query map.
            KcdQuery query = kcd.QueryMap[msg.ID];

            // Set the reply in the query.
            query.Res = msg;

            // We don't have non-workspace-related replies yet.
            Debug.Assert(query.Kws != null);

            // Dispatch the message to the workspace.
            query.Kws.Sm.HandleKcdReply(query);
            query.Terminate();
        }
예제 #4
0
파일: WmCoreOp.cs 프로젝트: tmbx/kwm-ng
 /// <summary>
 /// Cancel the KCD query specified and set its reference to null, 
 /// if needed.
 /// </summary>
 protected void ClearKcdQuery(ref KcdQuery query)
 {
     if (query != null)
     {
         query.Terminate();
         query = null;
     }
 }