Bug 70679 - [GTK] Build fixes for glib 2.31 (current master)
Summary: [GTK] Build fixes for glib 2.31 (current master)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-22 06:16 PDT by Philippe Normand
Modified: 2011-10-28 09:48 PDT (History)
3 users (show)

See Also:


Attachments
proposed patch (2.45 KB, patch)
2011-10-22 06:18 PDT, Philippe Normand
mrobinson: review-
Details | Formatted Diff | Diff
proposed patch (2.89 KB, patch)
2011-10-28 09:39 PDT, Philippe Normand
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2011-10-22 06:16:13 PDT
g_cond_new and g_mutex_new are replaced by _init functions. Same for _free, replaced by _clear.
Comment 1 Philippe Normand 2011-10-22 06:18:24 PDT
Created attachment 112088 [details]
proposed patch
Comment 2 Martin Robinson 2011-10-22 08:30:47 PDT
Comment on attachment 112088 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=112088&action=review

> Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp:115
> +#if GLIB_CHECK_VERSION(2, 31, 0)
> +    g_cond_init(priv->data_cond);
> +    g_mutex_init(priv->buffer_mutex);
> +#else
>      priv->data_cond = g_cond_new();
>      priv->buffer_mutex = g_mutex_new();
> +#endif
>  }

This seems wrong. You are passing uninitialized pointers to g_cond_init. It seems like you'll need to allocate a GCond structure first. Please use the WTF allocator too. :) The same pattern should be used for the GMutex stuff.

Would it be easier to simply use WTF threading primitives here?

> Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp:253
> +#if GLIB_CHECK_VERSION(2, 31, 0)
> +        g_cond_clear(priv->data_cond);
> +#else
>          g_cond_free(priv->data_cond);

And here you would need to free the allocated data.
Comment 3 Philippe Normand 2011-10-28 09:39:23 PDT
Created attachment 112878 [details]
proposed patch

Use WTF allocator and free allocated memory after clearing the mutex
and gcond.
Comment 4 Philippe Normand 2011-10-28 09:48:17 PDT
Committed r98731: <http://trac.webkit.org/changeset/98731>