HoloToolkit.Sharing.DiscoveryClient.RemoveListener C# (CSharp) Method

RemoveListener() public method

public RemoveListener ( DiscoveryClientListener oldListener ) : void
oldListener DiscoveryClientListener
return void
  public virtual void RemoveListener(DiscoveryClientListener oldListener) {
    SharingClientPINVOKE.DiscoveryClient_RemoveListener(swigCPtr, DiscoveryClientListener.getCPtr(oldListener));
  }

Usage Example

Example #1
0
        protected void OnDestroy()
        {
            Instance = null;

            if (this.discoveryClient != null)
            {
                discoveryClient.RemoveListener(discoveryClientAdapter);
                discoveryClient.Dispose();
                discoveryClient = null;

                if (discoveryClientAdapter != null)
                {
                    discoveryClientAdapter.Dispose();
                    discoveryClientAdapter = null;
                }
            }

            if (this.sharingMgr != null)
            {
                // Force a disconnection so that we can stop and start Unity without connections hanging around
                this.sharingMgr.GetPairedConnection().Disconnect();
                this.sharingMgr.GetServerConnection().Disconnect();

                // Release the XTools manager so that it cleans up the C++ copy
                this.sharingMgr.Dispose();
                this.sharingMgr = null;
            }
            // Forces a garbage collection to try to clean up any additional reference to SWIG-wrapped objects
            System.GC.Collect();
        }
All Usage Examples Of HoloToolkit.Sharing.DiscoveryClient::RemoveListener