[gnome-software/gnome-3-22] Make gs_app_add_category thread safe



commit 184e2f109cf50770b4032eb9a9cf2bb023ac86ac
Author: Joaquim Rocha <jrocha endlessm com>
Date:   Fri Dec 2 16:16:51 2016 +0100

    Make gs_app_add_category thread safe

 src/gs-app.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 11e1ad6..022195f 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -2918,6 +2918,7 @@ gs_app_set_categories (GsApp *app, GPtrArray *categories)
 void
 gs_app_add_category (GsApp *app, const gchar *category)
 {
+       g_autoptr(GMutexLocker) locker = g_mutex_locker_new (&app->mutex);
        g_return_if_fail (GS_IS_APP (app));
        g_return_if_fail (category != NULL);
        if (gs_app_has_category (app, category))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]