[gnome-builder/gnome-builder-3-38] search: fix fallout from search provider refactor
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-38] search: fix fallout from search provider refactor
- Date: Thu, 15 Oct 2020 23:32:08 +0000 (UTC)
commit c96edb13872d4eff8a4606c98783eaba6c3ecde5
Author: Christian Hergert <chergert redhat com>
Date: Thu Oct 15 16:31:44 2020 -0700
search: fix fallout from search provider refactor
This makes sure we take ownership of a search provider and cleanup state
properly at shutdown of the workbench.
src/libide/search/ide-search-engine.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/libide/search/ide-search-engine.c b/src/libide/search/ide-search-engine.c
index 5568fab68..1c5b25c17 100644
--- a/src/libide/search/ide-search-engine.c
+++ b/src/libide/search/ide-search-engine.c
@@ -140,7 +140,7 @@ ide_search_engine_destroy (IdeObject *object)
IdeSearchEngine *self = (IdeSearchEngine *)object;
g_clear_object (&self->extensions);
- g_clear_object (&self->custom_provider);
+ g_clear_pointer (&self->custom_provider, g_ptr_array_unref);
IDE_OBJECT_CLASS (ide_search_engine_parent_class)->destroy (object);
}
@@ -188,7 +188,7 @@ ide_search_engine_class_init (IdeSearchEngineClass *klass)
static void
ide_search_engine_init (IdeSearchEngine *self)
{
- self->custom_provider = g_ptr_array_new ();
+ self->custom_provider = g_ptr_array_new_with_free_func (g_object_unref);
}
IdeSearchEngine *
@@ -410,7 +410,7 @@ ide_search_engine_add_provider (IdeSearchEngine *self,
g_return_if_fail (IDE_IS_SEARCH_ENGINE (self));
g_return_if_fail (IDE_IS_SEARCH_PROVIDER (provider));
- g_ptr_array_add (self->custom_provider, provider);
+ g_ptr_array_add (self->custom_provider, g_object_ref (provider));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]