[gnome-online-accounts] Replace uses of g_mutex_{new, free} with g_mutex_{init, clear}
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] Replace uses of g_mutex_{new, free} with g_mutex_{init, clear}
- Date: Mon, 30 Apr 2012 12:41:29 +0000 (UTC)
commit f72cd266832466d17ee7f830c5e2e5b2f13ca7a9
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Apr 30 14:14:25 2012 +0200
Replace uses of g_mutex_{new, free} with g_mutex_{init, clear}
Bump minimum GLib version to 2.32.
configure.ac | 2 +-
src/goabackend/goaoauth2provider.c | 6 ++++--
src/goabackend/goaoauthprovider.c | 6 ++++--
3 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index aef5c5c..cc022c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,7 @@ GTK_DOC_CHECK([1.3])
# Libraries
#
-PKG_CHECK_MODULES(GLIB, [glib-2.0 gio-2.0 gio-unix-2.0 >= 2.29.5])
+PKG_CHECK_MODULES(GLIB, [glib-2.0 gio-2.0 gio-unix-2.0 >= 2.32])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index 663fbf8..459c758 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -1196,7 +1196,8 @@ goa_oauth2_provider_refresh_account (GoaProvider *_provider,
static void
free_mutex (GMutex *mutex)
{
- g_mutex_free (mutex);
+ g_mutex_clear (mutex);
+ g_slice_free (GMutex, mutex);
}
/**
@@ -1271,7 +1272,8 @@ goa_oauth2_provider_get_access_token_sync (GoaOAuth2Provider *provider,
lock = g_object_get_data (G_OBJECT (object), "-goa-oauth2-provider-get-access-token-lock");
if (lock == NULL)
{
- lock = g_mutex_new ();
+ lock = g_slice_new0 (GMutex);
+ g_mutex_init (lock);
g_object_set_data_full (G_OBJECT (object),
"-goa-oauth2-provider-get-access-token-lock",
lock,
diff --git a/src/goabackend/goaoauthprovider.c b/src/goabackend/goaoauthprovider.c
index 2f8e4dd..67c924c 100644
--- a/src/goabackend/goaoauthprovider.c
+++ b/src/goabackend/goaoauthprovider.c
@@ -1205,7 +1205,8 @@ goa_oauth_provider_refresh_account (GoaProvider *_provider,
static void
free_mutex (GMutex *mutex)
{
- g_mutex_free (mutex);
+ g_mutex_clear (mutex);
+ g_slice_free (GMutex, mutex);
}
/**
@@ -1288,7 +1289,8 @@ goa_oauth_provider_get_access_token_sync (GoaOAuthProvider *provider,
lock = g_object_get_data (G_OBJECT (object), "-goa-oauth-provider-get-access-token-lock");
if (lock == NULL)
{
- lock = g_mutex_new ();
+ lock = g_slice_new0 (GMutex);
+ g_mutex_init (lock);
g_object_set_data_full (G_OBJECT (object),
"-goa-oauth-provider-get-access-token-lock",
lock,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]