WMF: Fixed shutdown sequence.

A wrong shutdown sequence was causing a wait condition to never be met,
resulting in a 5 seconds hang on shutdown.
Also reduced the wait condition timeout to 100 ms.

Task-number: QTBUG-28432

Change-Id: Ib415bf66634603d839be3e34e497e3a3c5a19ad9
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Jason Barron <jason@cutehacks.com>
This commit is contained in:
Yoann Lopes
2012-12-06 15:42:47 +01:00
committed by The Qt Project
parent 31fdbb1c22
commit ad83534736
3 changed files with 4 additions and 3 deletions

View File

@@ -71,6 +71,8 @@ MFPlayerService::MFPlayerService(QObject *parent)
MFPlayerService::~MFPlayerService()
{
m_session->close();
#ifndef Q_WS_SIMULATOR
if (m_videoWindowControl)
delete m_videoWindowControl;
@@ -79,7 +81,6 @@ MFPlayerService::~MFPlayerService()
if (m_videoRendererControl)
delete m_videoRendererControl;
m_session->close();
m_session->Release();
}

View File

@@ -454,7 +454,7 @@ void MFPlayerSession::close()
if (m_session) {
hr = m_session->Close();
if (SUCCEEDED(hr)) {
DWORD dwWaitResult = WaitForSingleObject(m_hCloseEvent, 5000);
DWORD dwWaitResult = WaitForSingleObject(m_hCloseEvent, 100);
if (dwWaitResult == WAIT_TIMEOUT) {
qWarning() << "session close time out!";
}

View File

@@ -92,8 +92,8 @@ QMediaService* WMFServicePlugin::create(QString const& key)
void WMFServicePlugin::release(QMediaService *service)
{
releaseRefCount();
delete service;
releaseRefCount();
}
QMediaServiceProviderHint::Features WMFServicePlugin::supportedFeatures(