Changeset 196809 in webkit
- Timestamp:
- Feb 19, 2016 2:30:08 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r196807 r196809 1 2016-02-19 Philippe Normand <pnormand@igalia.com> 2 3 [GStreamer] clean-up various leaks 4 https://bugs.webkit.org/show_bug.cgi?id=154285 5 6 Reviewed by Carlos Garcia Campos. 7 8 * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: 9 (webkit_web_audio_src_init): Take full ownership of the GstTask. 10 * platform/graphics/gstreamer/GRefPtrGStreamer.cpp: 11 (WTF::adoptGRef): Null pointer support in ASSERTs. 12 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: 13 (WebCore::initializeGStreamerAndRegisterWebKitElements): Take full ownership of the GstElementFactory pointers. 14 (WebCore::MediaPlayerPrivateGStreamer::isAvailable): Ditto. 15 1 16 2016-02-18 Andy Estes <aestes@apple.com> 2 17 -
trunk/Source/WebCore/platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp
r185502 r196809 194 194 195 195 g_rec_mutex_init(&priv->mutex); 196 priv->task = gst_task_new(reinterpret_cast<GstTaskFunction>(webKitWebAudioSrcLoop), src, 0);196 priv->task = adoptGRef(gst_task_new(reinterpret_cast<GstTaskFunction>(webKitWebAudioSrcLoop), src, 0)); 197 197 198 198 gst_task_set_lock(priv->task.get(), &priv->mutex); -
trunk/Source/WebCore/platform/graphics/gstreamer/GRefPtrGStreamer.cpp
r195735 r196809 28 28 template <> GRefPtr<GstElement> adoptGRef(GstElement* ptr) 29 29 { 30 ASSERT(!ptr || !g_object_is_floating( G_OBJECT(ptr)));30 ASSERT(!ptr || !g_object_is_floating(ptr)); 31 31 return GRefPtr<GstElement>(ptr, GRefPtrAdopt); 32 32 } … … 48 48 template <> GRefPtr<GstPad> adoptGRef(GstPad* ptr) 49 49 { 50 ASSERT(!ptr || !g_object_is_floating( G_OBJECT(ptr)));50 ASSERT(!ptr || !g_object_is_floating(ptr)); 51 51 return GRefPtr<GstPad>(ptr, GRefPtrAdopt); 52 52 } … … 68 68 template <> GRefPtr<GstPadTemplate> adoptGRef(GstPadTemplate* ptr) 69 69 { 70 ASSERT(!ptr || !g_object_is_floating( G_OBJECT(ptr)));70 ASSERT(!ptr || !g_object_is_floating(ptr)); 71 71 return GRefPtr<GstPadTemplate>(ptr, GRefPtrAdopt); 72 72 } … … 106 106 template <> GRefPtr<GstContext> adoptGRef(GstContext* ptr) 107 107 { 108 ASSERT(!g_object_is_floating( G_OBJECT(ptr)));108 ASSERT(!g_object_is_floating(ptr)); 109 109 return GRefPtr<GstContext>(ptr, GRefPtrAdopt); 110 110 } … … 125 125 template <> GRefPtr<GstTask> adoptGRef(GstTask* ptr) 126 126 { 127 ASSERT(!g_object_is_floating(G_OBJECT(ptr))); 127 // There is no need to check the object reference is floating here because 128 // gst_task_init() always sinks it. 128 129 return GRefPtr<GstTask>(ptr, GRefPtrAdopt); 129 130 } … … 145 146 template <> GRefPtr<GstBus> adoptGRef(GstBus* ptr) 146 147 { 147 ASSERT(! g_object_is_floating(G_OBJECT(ptr)));148 ASSERT(!ptr || !g_object_is_floating(ptr)); 148 149 return GRefPtr<GstBus>(ptr, GRefPtrAdopt); 149 150 } … … 165 166 template <> GRefPtr<GstElementFactory> adoptGRef(GstElementFactory* ptr) 166 167 { 167 ASSERT(! g_object_is_floating(G_OBJECT(ptr)));168 ASSERT(!ptr || !g_object_is_floating(ptr)); 168 169 return GRefPtr<GstElementFactory>(ptr, GRefPtrAdopt); 169 170 } … … 318 319 template <> GRefPtr<WebKitVideoSink> adoptGRef(WebKitVideoSink* ptr) 319 320 { 320 ASSERT(!ptr || !g_object_is_floating( G_OBJECT(ptr)));321 ASSERT(!ptr || !g_object_is_floating(ptr)); 321 322 return GRefPtr<WebKitVideoSink>(ptr, GRefPtrAdopt); 322 323 } … … 338 339 template <> GRefPtr<WebKitWebSrc> adoptGRef(WebKitWebSrc* ptr) 339 340 { 340 ASSERT(!ptr || !g_object_is_floating( G_OBJECT(ptr)));341 ASSERT(!ptr || !g_object_is_floating(ptr)); 341 342 return GRefPtr<WebKitWebSrc>(ptr, GRefPtrAdopt); 342 343 } -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r196060 r196809 108 108 return false; 109 109 110 GRefPtr<GstElementFactory> srcFactory = gst_element_factory_find("webkitwebsrc");110 GRefPtr<GstElementFactory> srcFactory = adoptGRef(gst_element_factory_find("webkitwebsrc")); 111 111 if (!srcFactory) { 112 112 GST_DEBUG_CATEGORY_INIT(webkit_media_player_debug, "webkitmediaplayer", 0, "WebKit media player"); … … 115 115 116 116 #if ENABLE(MEDIA_SOURCE) 117 GRefPtr<GstElementFactory> WebKitMediaSrcFactory = gst_element_factory_find("webkitmediasrc");117 GRefPtr<GstElementFactory> WebKitMediaSrcFactory = adoptGRef(gst_element_factory_find("webkitmediasrc")); 118 118 if (!WebKitMediaSrcFactory) 119 119 gst_element_register(0, "webkitmediasrc", GST_RANK_PRIMARY + 100, WEBKIT_TYPE_MEDIA_SRC); … … 127 127 return false; 128 128 129 GRefPtr<GstElementFactory> factory = gst_element_factory_find("playbin");129 GRefPtr<GstElementFactory> factory = adoptGRef(gst_element_factory_find("playbin")); 130 130 return factory; 131 131 }
Note: See TracChangeset
for help on using the changeset viewer.