public void Dispose() { if (!IsDisposed) { guestControllerClient.OnAccessTokenChanged -= HandleGuestControllerAccessTokenChanged; localUser.OnPushNotificationsToggled -= HandlePushNotificationsToggled; notificationPoller.OnNotificationsPolled -= HandleNotificationsPolled; localUser.OnPushNotificationReceived -= HandlePushNotificationReceived; databaseCorruptionHandler.OnCorruptionDetected -= HandleCorruptionDetected; notificationPoller.Dispose(); userDatabase.Dispose(); mixWebCallFactory.Dispose(); coroutineManager.Stop(updateEnumerator); IsDisposed = true; } }