WMF Backend: Fix crash in MFPlayerService::releaseControl.

When releasing a video render control or a video window control, we
were deleting the object pointed to by the 'control' pointer, but
were not setting this pointer to 0 which left it dangling. Shortly
after we tried to cast this dangling pointer to another type which
crashed. The solution is just to return after deleting the control.

Change-Id: I9ab672c8b86a13af889d87c76141e6b8db5b74a7
Reviewed-by: Andy Nichols <andy.nichols@nokia.com>
This commit is contained in:
Jason Barron
2012-09-04 10:47:04 +02:00
committed by Qt by Nokia
parent c15b2833ba
commit bc2bce3629

View File

@@ -135,10 +135,12 @@ void MFPlayerService::releaseControl(QMediaControl *control)
m_videoRendererControl->setSurface(0);
delete m_videoRendererControl;
m_videoRendererControl = 0;
return;
#if defined(HAVE_WIDGETS) && !defined(Q_WS_SIMULATOR)
} else if (control == m_videoWindowControl) {
delete m_videoWindowControl;
m_videoWindowControl = 0;
return;
#endif
}