RESOLVED FIXED 135833
Clean up GMutexLocker
https://bugs.webkit.org/show_bug.cgi?id=135833
Summary Clean up GMutexLocker
Zan Dobersek
Reported 2014-08-12 02:19:01 PDT
Clean up GMutexLocker
Attachments
Patch (14.45 KB, patch)
2014-08-12 02:25 PDT, Zan Dobersek
no flags
Patch (14.76 KB, patch)
2014-08-12 03:13 PDT, Zan Dobersek
no flags
Zan Dobersek
Comment 1 2014-08-12 02:25:32 PDT
Carlos Garcia Campos
Comment 2 2014-08-12 02:55:08 PDT
Comment on attachment 236434 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=236434&action=review > Source/WTF/wtf/gobject/GMutexLocker.h:28 > -namespace WebCore { > +namespace WTF { wow! > Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp:237 > - if (priv->bufferMutex) { > - g_mutex_clear(priv->bufferMutex); > - delete priv->bufferMutex; > - priv->bufferMutex = 0; > - } > + g_mutex_clear(&priv->bufferMutex); You can't do this here, dispose might be called multiple times, and g_mutex_clear should not be used on an already cleared mutex, because the internal pointer is not checked and it's not reset either when freed. Since we are using placement new syntax, I would add a constructor of WebKitVideoSinkPrivate to init the mutex, and a destructor to clear it.
Zan Dobersek
Comment 3 2014-08-12 03:13:12 PDT
Zan Dobersek
Comment 4 2014-08-12 03:39:35 PDT
Comment on attachment 236436 [details] Patch Clearing flags on attachment: 236436 Committed r172441: <http://trac.webkit.org/changeset/172441>
Zan Dobersek
Comment 5 2014-08-12 03:39:42 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.