Skip to content

Commit

Permalink
Don't delete our private data and then dereference it on assignment t…
Browse files Browse the repository at this point in the history
…o self (cppcheck).
  • Loading branch information
daniel-kristjansson committed Aug 24, 2011
1 parent 87589c6 commit 1cec37d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mythtv/programs/mythfrontend/videoplayercommand.cpp
Expand Up @@ -392,8 +392,11 @@ VideoPlayerCommand::VideoPlayerCommand(const VideoPlayerCommand &other)

VideoPlayerCommand &VideoPlayerCommand::operator=(const VideoPlayerCommand &rhs)
{
delete m_d;
m_d = new VideoPlayerCommandPrivate(*rhs.m_d);
if (this != &rhs)
{
delete m_d;
m_d = new VideoPlayerCommandPrivate(*rhs.m_d);
}
return *this;
}

Expand Down

0 comments on commit 1cec37d

Please sign in to comment.