Commit b316c745 authored by bartfab's avatar bartfab Committed by Commit bot

Fix crash when shutting down affiliated invalidation service provider

When the affiliated invalidation service provider, it should:
1) unregister itself as an observer of various objects
2) tell consumers to stop using the current invalidation service
3) destroy the device-global invalidation service, if any

Steps 2 and 3 were swapped. This meant that if the device-global
invalidation service happened to be in use, it would be destroyed
without giving consumers a chance to remove their handlers from it.

BUG=455504
TEST=None

Review URL: https://codereview.chromium.org/942463002

Cr-Commit-Position: refs/heads/master@{#317017}
parent b21f85ae
......@@ -209,7 +209,7 @@ void AffiliatedInvalidationServiceProviderImpl::Shutdown() {
registrar_.RemoveAll();
profile_invalidation_service_observers_.clear();
DestroyDeviceInvalidationService();
device_invalidation_service_observer_.reset();
if (invalidation_service_) {
invalidation_service_ = nullptr;
......@@ -217,6 +217,8 @@ void AffiliatedInvalidationServiceProviderImpl::Shutdown() {
// is no longer available.
SetInvalidationService(nullptr);
}
DestroyDeviceInvalidationService();
}
invalidation::TiclInvalidationService*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment