Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2204)

Unified Diff: chrome/browser/spellchecker/spelling_service_client.cc

Issue 206453006: [Spellcheck, OSX] Fix crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellchecker/spelling_service_client.cc
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc
index 8ef8bcf738ddc350324f9c56deb8aa6677d1c55d..a0506ba052f848dc40e5f30e9cc8e8e10954bf22 100644
--- a/chrome/browser/spellchecker/spelling_service_client.cc
+++ b/chrome/browser/spellchecker/spelling_service_client.cc
@@ -254,8 +254,11 @@ void SpellingServiceClient::OnURLFetchComplete(
fetcher->GetResponseAsString(&data);
success = ParseResponse(data, &results);
}
- callback_data->callback.Run(success, callback_data->text, results);
spellcheck_fetchers_.erase(fetcher.get());
+
+ // The callback may release the last (transitive) dependency on |this|. It
+ // MUST be the last function called.
+ callback_data->callback.Run(success, callback_data->text, results);
}
net::URLFetcher* SpellingServiceClient::CreateURLFetcher(const GURL& url) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698