Bug 1339826 - Part 3: Add a self reference in Maintenance::Finish() to prevent self destruction while the method is still being executed; r=btseng

This commit is contained in:
Jan Varga 2017-04-28 17:43:03 +02:00
Родитель b8c306d6f2
Коммит a5802cc08e
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -19009,6 +19009,10 @@ Maintenance::Finish()
mDirectoryLock = nullptr;
// It can happen that we are only referenced by mCurrentMaintenance which is
// cleared in NoteFinishedMaintenance()
RefPtr<Maintenance> kungFuDeathGrip = this;
mQuotaClient->NoteFinishedMaintenance(this);
mState = State::Complete;