VirtualBox

Changeset 33689 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Nov 2, 2010 1:30:00 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt: Crash fix in UISettingsSerializer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp

    r33666 r33689  
    2323#include <QMutex>
    2424#include <QWaitCondition>
     25#include <QTimer>
    2526
    2627/* Local includes */
     
    7980        , m_data(data)
    8081        , m_fConditionDone(false)
     82        , m_fAllowToDestroySerializer(false)
    8183        , m_iPageIdWeAreWaitingFor(-1)
    8284        , m_iIdOfHighPriorityPage(-1)
     
    8587        connect(this, SIGNAL(sigNotifyAboutPageProcessed(int)), this, SLOT(sltHandleProcessedPage(int)), Qt::QueuedConnection);
    8688        connect(this, SIGNAL(sigNotifyAboutPagesProcessed()), this, SLOT(sltHandleProcessedPages()), Qt::QueuedConnection);
    87         connect(this, SIGNAL(finished()), this, SLOT(deleteLater()), Qt::QueuedConnection);
     89        connect(this, SIGNAL(finished()), this, SLOT(sltDestroySerializer()), Qt::QueuedConnection);
    8890
    8991        /* Set instance: */
     
    194196        if (!m_fConditionDone)
    195197            m_fConditionDone = true;
     198    }
     199
     200    /* Slot to destroy serializer: */
     201    void sltDestroySerializer()
     202    {
     203        /* If not yet all events were processed,
     204         * we should postpone destruction for now: */
     205        if (!m_fAllowToDestroySerializer)
     206            QTimer::singleShot(0, this, SLOT(sltDestroySerializer()));
     207        else
     208            deleteLater();
    196209    }
    197210
     
    214227            m_mutex.unlock();
    215228        }
     229        m_fAllowToDestroySerializer = true;
    216230    }
    217231
     
    261275    UISettingsPageMap m_pages;
    262276    bool m_fConditionDone;
     277    bool m_fAllowToDestroySerializer;
    263278    int m_iPageIdWeAreWaitingFor;
    264279    int m_iIdOfHighPriorityPage;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette