~dandrader/qtmir/logSurfaceType

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/session.cpp

  • Committer: Bileto Bot
  • Author(s): Nick Dedekind
  • Date: 2016-10-24 11:32:25 UTC
  • mfrom: (560.3.2 qtmir)
  • Revision ID: ci-train-bot@canonical.com-20161024113225-dxus6snh9ri2cpax
Close windows in reverse order. (LP: #1622717)

Approved by: Daniel d'Andrada

Show diffs side-by-side

added added

removed removed

Lines of Context:
341
341
 
342
342
    if (m_state == Stopped) return;
343
343
 
344
 
    for (int i = 0; i < m_surfaceList.count(); ++i) {
 
344
    // surface::close ends up removing the surface from the list.
 
345
    // Reverse iteration order to preserve the index.
 
346
    for (int i = m_surfaceList.count()-1; i >= 0; --i) {
345
347
        auto surface = static_cast<MirSurfaceInterface*>(m_surfaceList.get(i));
346
348
        surface->close();
347
349
    }