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

Unified Diff: webkit/glue/resource_fetcher.cc

Issue 149295: Don't forget to free the callbacks! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | « webkit/glue/resource_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/resource_fetcher.cc
===================================================================
--- webkit/glue/resource_fetcher.cc (revision 20031)
+++ webkit/glue/resource_fetcher.cc (working copy)
@@ -84,8 +84,10 @@
DCHECK(!completed_);
completed_ = true;
- if (callback_)
+ if (callback_.get()) {
callback_->Run(response_, data_);
+ callback_.reset();
+ }
}
void ResourceFetcher::didFail(WebURLLoader* loader, const WebURLError& error) {
@@ -93,8 +95,10 @@
completed_ = true;
// Go ahead and tell our delegate that we're done.
- if (callback_)
+ if (callback_.get()) {
callback_->Run(WebURLResponse(), std::string());
+ callback_.reset();
+ }
}
/////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « webkit/glue/resource_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698