Commit 23381cec authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Fix dangling event manager pointers

parent d94b0e19
......@@ -28,6 +28,7 @@ namespace VLC
Media::Media()
: Internal( NULL )
, m_eventManager( NULL )
{
}
......@@ -63,6 +64,7 @@ Media Media::asNode(Instance& instance, const std::string& nodeName)
Media::Media(const Media& another)
: Internal(another)
, m_eventManager( NULL )
{
retain();
if ( another.m_eventManager != NULL )
......@@ -80,6 +82,8 @@ Media& Media::operator=(const Media& another)
delete m_eventManager;
if ( another.m_eventManager != NULL )
m_eventManager = new EventManager( *another.m_eventManager );
else
m_eventManager = NULL;
retain();
return *this;
}
......
......@@ -30,6 +30,7 @@ namespace VLC
MediaList::MediaList(const MediaList& another)
: Internal( another )
, m_eventManager( NULL )
{
if ( another.m_eventManager )
m_eventManager = new EventManager( *another.m_eventManager );
......@@ -47,6 +48,8 @@ MediaList& MediaList::operator=(const MediaList& another)
delete m_eventManager;
if ( another.m_eventManager != NULL )
m_eventManager = new EventManager( *another.m_eventManager );
else
m_eventManager = NULL;
retain();
return *this;
}
......
......@@ -28,6 +28,7 @@ namespace VLC
MediaListPlayer::MediaListPlayer(const MediaListPlayer& another)
: Internal( another )
, m_eventManager( NULL )
{
if ( another.m_eventManager )
m_eventManager = new EventManager( *another.m_eventManager );
......@@ -45,6 +46,8 @@ MediaListPlayer& MediaListPlayer::operator=(const MediaListPlayer& another)
delete m_eventManager;
if ( another.m_eventManager )
m_eventManager = new EventManager( *another.m_eventManager );
else
m_eventManager = NULL;
retain();
return *this;
}
......
......@@ -30,11 +30,13 @@ namespace VLC
MediaPlayer::MediaPlayer()
: Internal( NULL )
, m_eventManager( NULL )
{
}
MediaPlayer::MediaPlayer(const MediaPlayer& another)
: Internal( another )
, m_eventManager( NULL )
{
if ( another.m_eventManager != NULL )
m_eventManager = new EventManager( *another.m_eventManager );
......@@ -52,6 +54,8 @@ MediaPlayer& MediaPlayer::operator=(const MediaPlayer& another)
delete m_eventManager;
if ( another.m_eventManager != NULL )
m_eventManager = new EventManager( *another.m_eventManager );
else
m_eventManager = NULL;
retain();
return *this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment