Bug 1678463 - Part 3: Use DELETE_ON_MAIN_THREAD refcounting with DataResolver, r=necko-reviewers,valentin

The resolver object held by DataResolver must be destroyed on the actor's worker
thread, as it holds non-threadsafe references.

Differential Revision: https://phabricator.services.mozilla.com/D97827
This commit is contained in:
Nika Layzell 2020-12-14 18:26:48 +00:00
parent 5367461411
commit 1cd7ee51fa

View File

@ -499,7 +499,10 @@ namespace {
class DataResolverBase {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(DataResolverBase)
// This type is threadsafe-refcounted, as it's referenced on the socket
// thread, but must be destroyed on the main thread.
NS_INLINE_DECL_THREADSAFE_REFCOUNTING_WITH_DELETE_ON_MAIN_THREAD(
DataResolverBase)
DataResolverBase() = default;