Bug 1426351 - WindowSurfaceWayland - delete WaylandDisplay owned by compositor thread at compositor thread, r=jhorak

MozReview-Commit-ID: 6jtdXuiTj1F

--HG--
extra : rebase_source : cc072ac276956e2f8299dcfef3934dc16dbfbeda
This commit is contained in:
Martin Stransky 2017-12-20 14:18:18 +01:00
Родитель 25684dd699
Коммит 72aad592e6
2 изменённых файлов: 4 добавлений и 2 удалений

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

@ -556,6 +556,7 @@ WindowSurfaceWayland::WindowSurfaceWayland(nsWindow *aWindow)
, mBackBuffer(nullptr)
, mFrameCallback(nullptr)
, mFrameCallbackSurface(nullptr)
, mDisplayThreadMessageLoop(MessageLoop::current())
, mDelayedCommit(false)
, mFullScreenDamage(false)
, mIsMainThread(NS_IsMainThread())
@ -574,8 +575,8 @@ WindowSurfaceWayland::~WindowSurfaceWayland()
if (!mIsMainThread) {
// We can be destroyed from main thread even though we was created/used
// in compositor thread. We have to unref/delete WaylandDisplay in compositor
// thread then.
MessageLoop::current()->PostTask(
// thread then and we can't use MessageLoop::current() here.
mDisplayThreadMessageLoop->PostTask(
NewRunnableFunction(&WaylandDisplayRelease, mWaylandDisplay->GetDisplay()));
} else {
WaylandDisplayRelease(mWaylandDisplay->GetDisplay());

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

@ -121,6 +121,7 @@ private:
WindowBackBuffer* mBackBuffer;
wl_callback* mFrameCallback;
wl_surface* mFrameCallbackSurface;
MessageLoop* mDisplayThreadMessageLoop;
bool mDelayedCommit;
bool mFullScreenDamage;
bool mIsMainThread;