summaryrefslogtreecommitdiff
path: root/slideshow
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-11 16:00:03 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-06-13 16:50:56 +0000
commitc2d65e08c9f6e35875eed1a4eea3af614478b801 (patch)
tree2c7152560fe57aec51197e4d9768c37170063afb /slideshow
parent9f3515f90c7b05d5f387dc15e2d6c10892e208bb (diff)
tdf#91960 presentation causes Impress crash
The SystenChildWindow in question is owned by ViewMediaShape Fixed ViewMediaShape to dispose the vcl objects it creates correctly. Also fix another crash in MediaWindowImpl child window correctly disposing its children. Change-Id: If4aebcb6e5824266c154416f7246d73c6cb3509c Reviewed-on: https://gerrit.libreoffice.org/16230 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'slideshow')
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.cxx18
-rw-r--r--slideshow/source/engine/shapes/viewmediashape.hxx4
2 files changed, 12 insertions, 10 deletions
diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx
index 6e481d30f656..654f91c3f5cd 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -148,8 +148,8 @@ namespace slideshow
mxPlayerWindow.clear();
}
- mpMediaWindow.reset();
- mpEventHandlerParent.reset();
+ mpMediaWindow.disposeAndClear();
+ mpEventHandlerParent.disposeAndClear();
// shutdown player
if( mxPlayer.is() )
@@ -471,20 +471,23 @@ namespace slideshow
#else
if( avmedia::IsModel(rMimeType) )
{
- mpEventHandlerParent.reset(VclPtr<vcl::Window>::Create(pWindow, WB_NOBORDER|WB_NODIALOGCONTROL));
+ mpMediaWindow.disposeAndClear();
+ mpEventHandlerParent.disposeAndClear();
+ mpEventHandlerParent = VclPtr<vcl::Window>::Create(pWindow, WB_NOBORDER|WB_NODIALOGCONTROL);
mpEventHandlerParent->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ),
Size( aAWTRect.Width, aAWTRect.Height ) );
mpEventHandlerParent->EnablePaint(false);
mpEventHandlerParent->Show();
SystemWindowData aWinData = OpenGLContext::generateWinData(mpEventHandlerParent.get(), false);
- mpMediaWindow.reset(VclPtr<SystemChildWindow>::Create(mpEventHandlerParent.get(), 0, &aWinData));
+ mpMediaWindow = VclPtr<SystemChildWindow>::Create(mpEventHandlerParent.get(), 0, &aWinData);
mpMediaWindow->SetPosSizePixel( Point( 0, 0 ),
Size( aAWTRect.Width, aAWTRect.Height ) );
}
else
#endif
{
- mpMediaWindow.reset( VclPtr<SystemChildWindow>::Create( pWindow, WB_CLIPCHILDREN ) );
+ mpMediaWindow.disposeAndClear();
+ mpMediaWindow = VclPtr<SystemChildWindow>::Create( pWindow, WB_CLIPCHILDREN );
mpMediaWindow->SetPosSizePixel( Point( aAWTRect.X, aAWTRect.Y ),
Size( aAWTRect.Width, aAWTRect.Height ) );
}
@@ -503,7 +506,6 @@ namespace slideshow
aAWTRect.X = aAWTRect.Y = 0;
aArgs[ 1 ] = uno::makeAny( aAWTRect );
-
aArgs[ 2 ] = uno::makeAny( reinterpret_cast< sal_IntPtr >( mpMediaWindow.get() ) );
mxPlayerWindow.set( mxPlayer->createPlayerWindow( aArgs ) );
@@ -519,8 +521,8 @@ namespace slideshow
{
//if there was no playerwindow, then clear the mpMediaWindow too
//so that we can draw a placeholder instead in that space
- mpMediaWindow.reset();
- mpEventHandlerParent.reset();
+ mpMediaWindow.disposeAndClear();
+ mpEventHandlerParent.disposeAndClear();
}
}
}
diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx b/slideshow/source/engine/shapes/viewmediashape.hxx
index 13eba7fce7bb..fe0462cd7e42 100644
--- a/slideshow/source/engine/shapes/viewmediashape.hxx
+++ b/slideshow/source/engine/shapes/viewmediashape.hxx
@@ -148,8 +148,8 @@ namespace slideshow
const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rVCLDeviceParams,
const OUString& rMimeType );
ViewLayerSharedPtr mpViewLayer;
- VclPtr< SystemChildWindow > mpMediaWindow;
- VclPtr< vcl::Window > mpEventHandlerParent;
+ VclPtr< SystemChildWindow > mpMediaWindow;
+ VclPtr< vcl::Window > mpEventHandlerParent;
mutable ::com::sun::star::awt::Point maWindowOffset;
mutable ::basegfx::B2DRectangle maBounds;