Delay the DidComposite call in ClientLayerManager's destructor. (bug 1305829, r=mattwoodrow)

This commit is contained in:
David Anderson 2016-09-28 01:24:45 -07:00
Родитель 053ecfd3c3
Коммит 67e19d1d22
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -112,8 +112,15 @@ ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
ClientLayerManager::~ClientLayerManager()
{
if (mTransactionIdAllocator) {
TimeStamp now = TimeStamp::Now();
DidComposite(mLatestTransactionId, now, now);
// Make sure to notify the refresh driver just in case it's waiting on a
// pending transaction.
RefPtr<TransactionIdAllocator> allocator = mTransactionIdAllocator;
uint64_t id = mLatestTransactionId;
RefPtr<Runnable> task = NS_NewRunnableFunction([allocator, id] () -> void {
allocator->NotifyTransactionCompleted(id);
});
NS_DispatchToMainThread(task.forget());
}
mMemoryPressureObserver->Destroy();
ClearCachedResources();