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

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

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