Index: net/url_request/url_request_context_getter.cc |
diff --git a/net/url_request/url_request_context_getter.cc b/net/url_request/url_request_context_getter.cc |
index db73fe3705f1e3016ed94993d757e3866c9b65cc..4cd9e3800f2510295a980a7d6622f3cec2394b91 100644 |
--- a/net/url_request/url_request_context_getter.cc |
+++ b/net/url_request/url_request_context_getter.cc |
@@ -22,7 +22,12 @@ void URLRequestContextGetter::OnDestruct() const { |
if (network_task_runner->BelongsToCurrentThread()) { |
delete this; |
} else { |
- network_task_runner->DeleteSoon(FROM_HERE, this); |
+ if (!network_task_runner->DeleteSoon(FROM_HERE, this)) { |
+ // Can't force-delete the object here, because some derived classes |
eroman
2012/08/15 18:00:44
Please change the language to not reference chrome
Andrew T Wilson (Slow)
2012/08/15 18:07:17
Ah, good point. I'll do this.
|
+ // (like ShellURLRequestContextGetter) may only be deleted on the IO |
+ // thread. |
+ DLOG(WARNING) << "URLRequestContextGetter leaking due to no IO thread."; |
eroman
2012/08/15 18:00:44
How about making this simply LOG(WARNING)?
Andrew T Wilson (Slow)
2012/08/15 18:07:17
Since this really only impacts unit tests, I figur
|
+ } |
} |
} |
// If no IO message loop proxy was available, we will just leak memory. |