Bug 1411977 - Part 4: Only try to dispatch the release of TransportLayers when there is a target thread. r=drno

MozReview-Commit-ID: 8fOkZwcxKHy

--HG--
extra : rebase_source : 29eafb58f0207e2d0b973ce8e846ce437a23317e
This commit is contained in:
Byron Campen [:bwc] 2018-01-25 09:55:12 -06:00
parent 2dc55eb3d7
commit 83c9be0a4e

View File

@ -35,10 +35,12 @@ TransportFlow::~TransportFlow() {
// destroy it simultaneously. The conversion to an nsAutoPtr
// ensures automatic destruction of the queue at exit of
// DestroyFinal.
nsAutoPtr<std::deque<TransportLayer*>> layers_tmp(layers_.release());
RUN_ON_THREAD(target_,
WrapRunnableNM(&TransportFlow::DestroyFinal, layers_tmp),
NS_DISPATCH_NORMAL);
if (target_) {
nsAutoPtr<std::deque<TransportLayer*>> layers_tmp(layers_.release());
RUN_ON_THREAD(target_,
WrapRunnableNM(&TransportFlow::DestroyFinal, layers_tmp),
NS_DISPATCH_NORMAL);
}
}
void TransportFlow::DestroyFinal(nsAutoPtr<std::deque<TransportLayer *> > layers) {