Title: [98654] trunk/Source/WebCore
Revision
98654
Author
[email protected]
Date
2011-10-27 16:06:26 -0700 (Thu, 27 Oct 2011)

Log Message

[GStreamer] Prevent memory leak when fullscreening a video
https://bugs.webkit.org/show_bug.cgi?id=71043

Patch by Jonathon Jongsma <[email protected]> on 2011-10-27
Reviewed by Gustavo Noronha Silva.

* platform/graphics/gstreamer/GStreamerGWorld.cpp:
(WebCore::GStreamerGWorld::GStreamerGWorld):
(WebCore::GStreamerGWorld::enterFullscreen):
(WebCore::GStreamerGWorld::exitFullscreen):
* platform/graphics/gstreamer/GStreamerGWorld.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98653 => 98654)


--- trunk/Source/WebCore/ChangeLog	2011-10-27 23:03:08 UTC (rev 98653)
+++ trunk/Source/WebCore/ChangeLog	2011-10-27 23:06:26 UTC (rev 98654)
@@ -1,3 +1,16 @@
+2011-10-27  Jonathon Jongsma  <[email protected]>
+
+        [GStreamer] Prevent memory leak when fullscreening a video
+        https://bugs.webkit.org/show_bug.cgi?id=71043
+
+        Reviewed by Gustavo Noronha Silva.
+
+        * platform/graphics/gstreamer/GStreamerGWorld.cpp:
+        (WebCore::GStreamerGWorld::GStreamerGWorld):
+        (WebCore::GStreamerGWorld::enterFullscreen):
+        (WebCore::GStreamerGWorld::exitFullscreen):
+        * platform/graphics/gstreamer/GStreamerGWorld.h:
+
 2011-10-27  Joseph Pecoraro  <[email protected]>
 
         Reviewed by David Kilzer.

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp (98653 => 98654)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp	2011-10-27 23:03:08 UTC (rev 98653)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.cpp	2011-10-27 23:06:26 UTC (rev 98654)
@@ -57,7 +57,6 @@
 
 GStreamerGWorld::GStreamerGWorld(GstElement* pipeline)
     : m_pipeline(pipeline)
-    , m_dynamicPadName(0)
 {
     // XOverlay messages need to be handled synchronously.
     GstBus* bus = gst_pipeline_get_bus(GST_PIPELINE(m_pipeline));
@@ -105,7 +104,7 @@
     gst_pad_link(srcPad, sinkPad);
     gst_object_unref(GST_OBJECT(sinkPad));
 
-    m_dynamicPadName = gst_pad_get_name(srcPad);
+    m_dynamicPadName.set(gst_pad_get_name(srcPad));
 
     // Synchronize the new elements with pipeline state. If it's
     // paused limit the state change to pre-rolling.
@@ -164,7 +163,7 @@
     GstElement* videoScale = gst_bin_get_by_name(GST_BIN(videoSink.get()), "videoScale");
 
     // Get pads to unlink and remove.
-    GstPad* srcPad = gst_element_get_static_pad(tee, m_dynamicPadName);
+    GstPad* srcPad = gst_element_get_static_pad(tee, m_dynamicPadName.get());
     GstPad* sinkPad = gst_element_get_static_pad(queue, "sink");
 
     // Block data flow towards the pipeline branch to remove. No need
@@ -195,7 +194,7 @@
     gst_object_unref(platformVideoSink);
 
     gst_object_unref(tee);
-    m_dynamicPadName = 0;
+    m_dynamicPadName.clear();
 }
 
 void GStreamerGWorld::setWindowOverlay(GstMessage* message)

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h (98653 => 98654)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h	2011-10-27 23:03:08 UTC (rev 98653)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerGWorld.h	2011-10-27 23:06:26 UTC (rev 98654)
@@ -22,6 +22,7 @@
 #define GStreamerGWorld_h
 #if ENABLE(VIDEO) && USE(GSTREAMER)
 
+#include "GOwnPtr.h"
 #include "PlatformVideoWindow.h"
 #include "RefCounted.h"
 #include "RefPtr.h"
@@ -60,7 +61,7 @@
     GStreamerGWorld(GstElement*);
     GstElement* m_pipeline;
     RefPtr<PlatformVideoWindow> m_videoWindow;
-    gchar* m_dynamicPadName;
+    GOwnPtr<gchar> m_dynamicPadName;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to