on xenial help sign in
Fix Unity.Application mock bug: SurfaceManager.surfaceDestroyed(null)

Change the order of things so that SurfaceManager.surfaceDestroyed() gets emited *before* the application surface is set to null. That way ApplicationInfo::createSurface() and ApplicationInfo::destroySurface() are symmetric, as they should be.

commit9d4c1560972fbc7b9fee2942604751d9a615e124 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateWed 23 Jul 2014, 12:25 (12 years ago) parentd63f867
1 file changed+3−2
tests/mocks/Unity/Application/ApplicationInfo.cpp+3−2
tests/mocks/Unity/Application/ApplicationInfo.cpp+3−2
@@ -91,11 +91,12 @@ void ApplicationInfo::createSurface()
9191void ApplicationInfo::destroySurface()
9292{
9393 if (!m_surface) return;
94+
95+ SurfaceManager::singleton()->unregisterSurface(m_surface);
96+
9497 MirSurfaceItem* oldSurface = m_surface;
9598 m_surface = nullptr;
96−
9799 Q_EMIT surfaceChanged(nullptr);
98− SurfaceManager::singleton()->unregisterSurface(m_surface);
99100 oldSurface->deleteLater();
100101}
101102