summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-08-22 19:07:12 +0100
committerAndras Timar <andras.timar@collabora.com>2015-08-31 15:11:22 +0200
commit9e59f241b973b0fe523b8a097f2fa8fd9f9bbf65 (patch)
treeae96fb23b53da2727b6934340ea9f740388ced5d /avmedia
parentd7180aeade507e0b709104e827cb14cd8fe919d7 (diff)
tdf#93188 - avoid crash in media player.
ToggleFloatingMode can be run during dispose, and should handle that, thanks to Maxim Monastirsky for the analysis. Change-Id: I72c5aff9b75fa2c1b6795e239370244dafdafae2 Reviewed-on: https://gerrit.libreoffice.org/17931 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/framework/mediaplayer.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/avmedia/source/framework/mediaplayer.cxx b/avmedia/source/framework/mediaplayer.cxx
index 28adf1959c8e..b9c2b672d387 100644
--- a/avmedia/source/framework/mediaplayer.cxx
+++ b/avmedia/source/framework/mediaplayer.cxx
@@ -101,12 +101,16 @@ void MediaFloater::ToggleFloatingMode()
{
::avmedia::MediaItem aRestoreItem;
- mpMediaWindow->updateMediaItem( aRestoreItem );
+ if (mpMediaWindow)
+ mpMediaWindow->updateMediaItem( aRestoreItem );
delete mpMediaWindow;
mpMediaWindow = NULL;
SfxDockingWindow::ToggleFloatingMode();
+ if (isDisposed())
+ return;
+
mpMediaWindow = new MediaWindow( this, true );
mpMediaWindow->setPosSize( Rectangle( Point(), GetOutputSizePixel() ) );