WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 220463
[GStreamer] Clean-up the TextCombiner
https://bugs.webkit.org/show_bug.cgi?id=220463
Summary
[GStreamer] Clean-up the TextCombiner
Philippe Normand
Reported
2021-01-08 08:01:54 PST
Coding style does not conform WebKit's, and it should use the WEBKIT_DEFINE_TYPE machinery.
Attachments
Patch
(33.74 KB, patch)
2021-01-11 08:37 PST
,
Philippe Normand
no flags
Details
Formatted Diff
Diff
Patch
(33.88 KB, patch)
2021-01-14 07:58 PST
,
Philippe Normand
calvaris
: review+
calvaris
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Philippe Normand
Comment 1
2021-01-11 08:37:55 PST
Created
attachment 417382
[details]
Patch
Xabier Rodríguez Calvar
Comment 2
2021-01-12 07:57:43 PST
Comment on
attachment 417382
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=417382&action=review
> Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp:121 > + auto internalPad = adoptGRef(gst_element_request_pad(combiner->priv->combinerElement.get(), templ, name, caps)); > + g_object_set(WEBKIT_TEXT_COMBINER_PAD(ghostPad), "inner-combiner-pad", internalPad.leakRef(), nullptr);
You're probably astonished that I tell you this but I don't think you need to create a smart ptr to just release it in the next line.
> Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp:142 > + gst_element_release_request_pad(combiner->priv->combinerElement.get(), webKitTextCombinerPadLeakInternalPadRef(combinerPad));
Aren't we leaking here? gst_element_release_request_pad doc says "This does not unref the pad. If the pad was created by using gst_element_request_pad(), gst_element_release_request_pad() needs to be followed by gst_object_unref() to free the pad."
> Source/WebCore/platform/graphics/gstreamer/TextCombinerPadGStreamer.cpp:32 > +#include "GStreamerCommon.h"
You don't need this if you include it in the header.
> Source/WebCore/platform/graphics/gstreamer/TextCombinerPadGStreamer.h:31 > +#include "GRefPtrGStreamer.h"
GStreamerCommon.h?
Philippe Normand
Comment 3
2021-01-12 08:13:55 PST
Comment on
attachment 417382
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=417382&action=review
>> Source/WebCore/platform/graphics/gstreamer/TextCombinerPadGStreamer.h:31 >> +#include "GRefPtrGStreamer.h" > > GStreamerCommon.h?
I was profiling the impact of including that header recently, here it adds a 2 seconds wall-time overhead. So unless really needed I now prefer to not include it directly, there is a way to reduce the impact it has but this is another rabbit hole :)
Philippe Normand
Comment 4
2021-01-14 07:58:46 PST
Created
attachment 417620
[details]
Patch
Xabier Rodríguez Calvar
Comment 5
2021-01-14 09:15:52 PST
Comment on
attachment 417620
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=417620&action=review
> Source/WebCore/platform/graphics/gstreamer/TextCombinerGStreamer.cpp:142 > + auto* internalPad = webKitTextCombinerPadLeakInternalPadRef(combinerPad); > + gst_element_release_request_pad(combiner->priv->combinerElement.get(), internalPad); > + gst_object_unref(internalPad);
Nit: I would adopt it here not unref. I would try to avoid manual unrefs as much as possible cause they can lead to leaks if we change the code around and forget to call it when it is due.
Philippe Normand
Comment 6
2021-01-15 01:27:32 PST
Committed
r271512
: <
https://trac.webkit.org/changeset/271512
>
Radar WebKit Bug Importer
Comment 7
2021-01-15 01:28:14 PST
<
rdar://problem/73239616
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug