Bug 1343069 - Capture a strong reference to nsRootPresContext in EnsureEventualDidPaintEvent, r=mattwoodrow

MozReview-Commit-ID: GRi4afSovP4
This commit is contained in:
Michael Layzell 2017-02-28 13:37:58 -05:00
parent dba2e68a7e
commit a54cbcb40f

View File

@ -3268,9 +3268,10 @@ nsRootPresContext::EnsureEventualDidPaintEvent(uint64_t aTransactionId)
nsCOMPtr<nsITimer> timer = do_CreateInstance("@mozilla.org/timer;1");
if (timer) {
nsresult rv = timer->InitWithCallback(NewTimerCallback([=](){
RefPtr<nsRootPresContext> self = this;
nsresult rv = timer->InitWithCallback(NewTimerCallback([self, aTransactionId](){
nsAutoScriptBlocker blockScripts;
this->NotifyDidPaintForSubtree(aTransactionId);
self->NotifyDidPaintForSubtree(aTransactionId);
}), 100, nsITimer::TYPE_ONE_SHOT);
if (NS_SUCCEEDED(rv)) {