/// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { // Make sure to stop the watcher on suspend. watcher.Stop(); // Always unregister the handlers to release the resources to prevent leaks. watcher.Received -= OnAdvertisementReceived; // Dispose the Firehose client if (_client != null) { _client.Dispose(); } }
public void Dispose() { _kinesisFirehoseClient.Dispose(); }