зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1454594 - Follow-up to clear the static pointers on shutdown. r=botond
MozReview-Commit-ID: 5NVaBGIzbMR
This commit is contained in:
Родитель
d0a67d958e
Коммит
5beb01b971
|
@ -8,6 +8,7 @@
|
|||
|
||||
#include "APZCTreeManager.h"
|
||||
#include "AsyncPanZoomController.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/layers/APZThreadUtils.h"
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
#include "mozilla/layers/LayerMetricsWrapper.h"
|
||||
|
@ -52,6 +53,11 @@ APZSampler::SetWebRenderWindowId(const wr::WindowId& aWindowId)
|
|||
mWindowId = Some(aWindowId);
|
||||
if (!sWindowIdMap) {
|
||||
sWindowIdMap = new std::unordered_map<uint64_t, APZSampler*>();
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableFunction("APZUpdater::ClearOnShutdown", [] {
|
||||
ClearOnShutdown(&sWindowIdMap);
|
||||
}
|
||||
));
|
||||
}
|
||||
(*sWindowIdMap)[wr::AsUint64(aWindowId)] = this;
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "APZCTreeManager.h"
|
||||
#include "AsyncPanZoomController.h"
|
||||
#include "base/task.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/layers/APZThreadUtils.h"
|
||||
#include "mozilla/layers/CompositorThread.h"
|
||||
#include "mozilla/layers/SynchronousTask.h"
|
||||
|
@ -59,6 +60,11 @@ APZUpdater::SetWebRenderWindowId(const wr::WindowId& aWindowId)
|
|||
mWindowId = Some(aWindowId);
|
||||
if (!sWindowIdMap) {
|
||||
sWindowIdMap = new std::unordered_map<uint64_t, APZUpdater*>();
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableFunction("APZUpdater::ClearOnShutdown", [] {
|
||||
ClearOnShutdown(&sWindowIdMap);
|
||||
}
|
||||
));
|
||||
}
|
||||
(*sWindowIdMap)[wr::AsUint64(aWindowId)] = this;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче