From e282331a703dffcf11f49b2522c197fc80249474 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Fri, 16 May 2014 17:13:04 +0200 Subject: [PATCH] Bug 1011487 - HTTP cache v2: WalkCacheRunnable may release it's callback on a non-main thread, r=michal --- netwerk/cache2/CacheStorageService.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp index 80b4b085f912..9f9e90d47c40 100644 --- a/netwerk/cache2/CacheStorageService.cpp +++ b/netwerk/cache2/CacheStorageService.cpp @@ -179,6 +179,14 @@ protected: , mNotifyStorage(true) , mVisitEntries(aVisitEntries) { + MOZ_ASSERT(NS_IsMainThread()); + } + + virtual ~WalkCacheRunnable() + { + if (mCallback) { + ProxyReleaseMainThread(mCallback); + } } nsRefPtr mService;