[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [phonon-vlc] src: Fix possible crash during destruction of VideoWidget
From:       Tobias Koenig <tokoe () kde ! org>
Date:       2012-09-22 9:06:00
Message-ID: 20120922090600.60174A6094 () git ! kde ! org
[Download RAW message or body]

Git commit a8cda824ae8a81059c75e97d8a82d571ba84e459 by Tobias Koenig.
Committed on 22/09/2012 at 11:04.
Pushed by tokoe into branch 'master'.

Fix possible crash during destruction of VideoWidget

If the MediaObject is deleted before the VideoWidget (SinkNode), the
destructor will access an invalid object. So guard the m_mediaObject
with a QPointer to know always whether it has been deleted.

M  +3    -1    src/sinknode.h

http://commits.kde.org/phonon-vlc/a8cda824ae8a81059c75e97d8a82d571ba84e459

diff --git a/src/sinknode.h b/src/sinknode.h
index 7c7c3ed..026a99a 100644
--- a/src/sinknode.h
+++ b/src/sinknode.h
@@ -24,6 +24,8 @@
 #ifndef PHONON_VLC_SINKNODE_H
 #define PHONON_VLC_SINKNODE_H
 
+#include <QPointer>
+
 namespace Phonon {
 namespace VLC {
 
@@ -69,7 +71,7 @@ public:
     virtual void addToMedia(Media *media);
 
 protected:
-    MediaObject *m_mediaObject;
+    QPointer<MediaObject> m_mediaObject;
     MediaPlayer *m_player;
 };
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic