avmedia: convert new to ::Create to get initial ref-counting right.

Change-Id: If7441005123ba1427d308b999af84b0c55a94a07
This commit is contained in:
Michael Meeks
2015-04-16 21:04:34 +01:00
parent 5430eb76db
commit 384e705a9e
4 changed files with 12 additions and 12 deletions

View File

@@ -65,13 +65,13 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
Control( pParent ),
maImageList( SvtMiscOptions().AreCurrentSymbolsLarge() ? AVMEDIA_RESID( AVMEDIA_IMGLST_L ) : AVMEDIA_RESID( AVMEDIA_IMGLST ) ),
maItem( 0, AVMediaSetMask::ALL ),
maPlayToolBox( new ToolBox(this, WB_3DLOOK) ),
maTimeSlider( new Slider(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ),
maMuteToolBox( new ToolBox(this, WB_3DLOOK) ),
maVolumeSlider( new Slider(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ),
maZoomToolBox( new ToolBox(this, WB_3DLOOK) ),
mpZoomListBox( new ListBox( maZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ),
maTimeEdit( new Edit(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK | WB_READONLY) ),
maPlayToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ),
maTimeSlider( VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_3DLOOK | WB_SLIDERSET) ),
maMuteToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ),
maVolumeSlider( VclPtr<Slider>::Create(this, WB_HORZ | WB_DRAG | WB_SLIDERSET) ),
maZoomToolBox( VclPtr<ToolBox>::Create(this, WB_3DLOOK) ),
mpZoomListBox( VclPtr<ListBox>::Create( maZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ),
maTimeEdit( VclPtr<Edit>::Create(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK | WB_READONLY) ),
meControlStyle( eControlStyle ),
mbLocked( false )
{

View File

@@ -40,7 +40,7 @@ namespace avmedia
MediaPlayer::MediaPlayer( vcl::Window* _pParent, sal_uInt16 nId, SfxBindings* _pBindings, SfxChildWinInfo* pInfo ) :
SfxChildWindow( _pParent, nId )
{
pWindow = new MediaFloater( _pBindings, this, _pParent );
pWindow = VclPtr<MediaFloater>::Create( _pBindings, this, _pParent );
eChildAlignment = SfxChildAlignment::NOALIGNMENT;
static_cast< MediaFloater* >( pWindow.get() )->Initialize( pInfo );
};

View File

@@ -46,7 +46,7 @@ namespace avmedia {
MediaWindow::MediaWindow( vcl::Window* parent, bool bInternalMediaControl ) :
mpImpl( new priv::MediaWindowImpl( parent, this, bInternalMediaControl ) )
mpImpl( VclPtr<priv::MediaWindowImpl>::Create( parent, this, bInternalMediaControl ) )
{
mpImpl->Show();
}

View File

@@ -156,7 +156,7 @@ MediaWindowImpl::MediaWindowImpl( vcl::Window* pParent, MediaWindow* pMediaWindo
mpMediaWindow( pMediaWindow ),
mpEvents( NULL ),
mbEventTransparent(true),
mpMediaWindowControl( bInternalMediaControl ? new MediaWindowControl( this ) : NULL ),
mpMediaWindowControl( bInternalMediaControl ? VclPtr<MediaWindowControl>::Create( this ) : nullptr ),
mpEmptyBmpEx( NULL ),
mpAudioBmpEx( NULL )
{
@@ -509,14 +509,14 @@ void MediaWindowImpl::onURLChanged()
if( m_sMimeType == AVMEDIA_MIMETYPE_COMMON )
{
mpChildWindow.disposeAndClear();
mpChildWindow.reset(new MediaChildWindow(this) );
mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this) );
}
#if HAVE_FEATURE_GLTF
else if ( m_sMimeType == AVMEDIA_MIMETYPE_JSON )
{
SystemWindowData aWinData = OpenGLContext::generateWinData(this, false);
mpChildWindow.disposeAndClear();
mpChildWindow.reset(new MediaChildWindow(this,&aWinData));
mpChildWindow.reset(VclPtr<MediaChildWindow>::Create(this,&aWinData));
mbEventTransparent = false;
}
#endif