diff options
author | Frans Englich <frans.englich@nokia.com> | 2009-10-07 12:29:06 (GMT) |
---|---|---|
committer | Frans Englich <frans.englich@nokia.com> | 2009-10-07 12:29:06 (GMT) |
commit | 350f97874544396a99cf82b47eb9a6e50838a88a (patch) | |
tree | 7b47a9b60225d23bb6749ee3552d9e156dbf56ae /src/3rdparty | |
parent | 16e21cb0beb0e5f5189048b95d1cb74ae0c0702a (diff) | |
download | Qt-350f97874544396a99cf82b47eb9a6e50838a88a.zip Qt-350f97874544396a99cf82b47eb9a6e50838a88a.tar.gz Qt-350f97874544396a99cf82b47eb9a6e50838a88a.tar.bz2 |
Use QScopedPointer for AudioPlayer's CPlayerType.
Reviewed-by: Gareth Stockwell
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/phonon/mmf/audioplayer.cpp | 9 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/audioplayer.h | 5 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/3rdparty/phonon/mmf/audioplayer.cpp b/src/3rdparty/phonon/mmf/audioplayer.cpp index 6c1fc68..ceaf305 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.cpp +++ b/src/3rdparty/phonon/mmf/audioplayer.cpp @@ -34,14 +34,13 @@ using namespace Phonon::MMF; // Constructor / destructor //----------------------------------------------------------------------------- -MMF::AudioPlayer::AudioPlayer() : m_player(0) +MMF::AudioPlayer::AudioPlayer() { construct(); } MMF::AudioPlayer::AudioPlayer(const AbstractPlayer& player) : AbstractMediaPlayer(player) - , m_player(0) { construct(); } @@ -51,7 +50,7 @@ void MMF::AudioPlayer::construct() TRACE_CONTEXT(AudioPlayer::AudioPlayer, EAudioApi); TRACE_ENTRY_0(); - TRAPD(err, m_player = CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone)); + TRAPD(err, m_player.reset(CPlayerType::NewL(*this, 0, EMdaPriorityPreferenceNone))); if (KErrNone != err) { changeState(ErrorState); } @@ -64,8 +63,6 @@ MMF::AudioPlayer::~AudioPlayer() TRACE_CONTEXT(AudioPlayer::~AudioPlayer, EAudioApi); TRACE_ENTRY_0(); - delete m_player; - TRACE_EXIT_0(); } @@ -237,7 +234,7 @@ void MMF::AudioPlayer::MapcPlayComplete(TInt aError) CPlayerType *MMF::AudioPlayer::player() const { - return m_player; + return m_player.data(); } diff --git a/src/3rdparty/phonon/mmf/audioplayer.h b/src/3rdparty/phonon/mmf/audioplayer.h index f16de1d..60ef436 100644 --- a/src/3rdparty/phonon/mmf/audioplayer.h +++ b/src/3rdparty/phonon/mmf/audioplayer.h @@ -86,6 +86,9 @@ public: virtual void MapcPlayComplete(TInt aError); #endif + /** + * This class owns the pointer. + */ CPlayerType *player() const; private: @@ -96,7 +99,7 @@ private: * Using CPlayerType typedef in order to be able to easily switch between * CMdaAudioPlayerUtility and CDrmPlayerUtility */ - CPlayerType* m_player; + QScopedPointer<CPlayerType> m_player; }; } } |