diff options
author | Richard Hughes <richard@hughsie.com> | 2016-11-02 15:26:04 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-11-02 15:26:04 +0000 |
commit | 08506bfbf112078bb2508b77c6050bb2815f7e87 (patch) | |
tree | c50767fdb621f618218a421c903d79251f20c007 /libappstream-glib/as-stemmer.c | |
parent | 8bfba559004253aeabcf9a26f4edd7cccbe70770 (diff) | |
download | appstream-glib-08506bfbf112078bb2508b77c6050bb2815f7e87.tar.gz |
trivial: Unsingleton AsStemmer and use a shared instance in AsStore
This allows us to test the stemming functionality with different locales.
Diffstat (limited to 'libappstream-glib/as-stemmer.c')
-rw-r--r-- | libappstream-glib/as-stemmer.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/libappstream-glib/as-stemmer.c b/libappstream-glib/as-stemmer.c index b3505dd..b5017ad 100644 --- a/libappstream-glib/as-stemmer.c +++ b/libappstream-glib/as-stemmer.c @@ -39,8 +39,6 @@ struct _AsStemmer G_DEFINE_TYPE (AsStemmer, as_stemmer, G_TYPE_OBJECT) -static gpointer as_stemmer_object = NULL; - /** * as_stemmer_process: * @stemmer: A #AsStemmer @@ -112,11 +110,6 @@ as_stemmer_init (AsStemmer *stemmer) AsStemmer * as_stemmer_new (void) { - if (as_stemmer_object != NULL) { - g_object_ref (as_stemmer_object); - } else { - as_stemmer_object = g_object_new (AS_TYPE_STEMMER, NULL); - g_object_add_weak_pointer (as_stemmer_object, &as_stemmer_object); - } - return AS_STEMMER (as_stemmer_object); + AsStemmer *stemmer = g_object_new (AS_TYPE_STEMMER, NULL); + return AS_STEMMER (stemmer); } |