Commit eb551e22 authored by Christian Hergert's avatar Christian Hergert

plugins: use dzl_clear_pointer()

This uses the new dzl_clear_pointer() to free data instead of
g_clear_pointer() because it allows us better type checking of
the callback parameter and the data to be freed.

We want to keep using this going forward so that we catch errors
sooner from miss-use of incorrect callbacks.
parent 98f60935
Pipeline #16267 passed with stage
in 21 minutes and 28 seconds
......@@ -130,7 +130,7 @@ ide_autotools_autogen_stage_finalize (GObject *object)
{
IdeAutotoolsAutogenStage *self = (IdeAutotoolsAutogenStage *)object;
g_clear_pointer (&self->srcdir, g_free);
dzl_clear_pointer (&self->srcdir, g_free);
G_OBJECT_CLASS (ide_autotools_autogen_stage_parent_class)->finalize (object);
}
......
......@@ -543,7 +543,7 @@ ide_autotools_build_system_finalize (GObject *object)
{
IdeAutotoolsBuildSystem *self = (IdeAutotoolsBuildSystem *)object;
g_clear_pointer (&self->tarball_name, g_free);
dzl_clear_pointer (&self->tarball_name, g_free);
g_clear_object (&self->project_file);
G_OBJECT_CLASS (ide_autotools_build_system_parent_class)->finalize (object);
......
......@@ -51,7 +51,7 @@ ide_autotools_build_target_finalize (GObject *object)
g_clear_object (&self->build_directory);
g_clear_object (&self->install_directory);
g_clear_pointer (&self->name, g_free);
dzl_clear_pointer (&self->name, g_free);
G_OBJECT_CLASS (ide_autotools_build_target_parent_class)->finalize (object);
}
......
......@@ -215,7 +215,7 @@ ide_autotools_make_stage_execute_async (IdeBuildStage *stage,
}
/* Clear the chained target so we do not run it again */
g_clear_pointer (&self->chained_target, g_free);
dzl_clear_pointer (&self->chained_target, g_free);
/* Log the process arguments to stdout */
argv = ide_subprocess_launcher_get_argv (launcher);
......@@ -369,7 +369,7 @@ ide_autotools_make_stage_chain (IdeBuildStage *stage,
if ((g_strcmp0 (self->target, "all") == 0) &&
(g_strcmp0 (IDE_AUTOTOOLS_MAKE_STAGE (next)->target, "install") == 0))
{
g_clear_pointer (&self->chained_target, g_free);
dzl_clear_pointer (&self->chained_target, g_free);
self->chained_target = g_strdup ("install");
return TRUE;
}
......@@ -383,9 +383,9 @@ ide_autotools_make_stage_finalize (GObject *object)
{
IdeAutotoolsMakeStage *self = (IdeAutotoolsMakeStage *)object;
g_clear_pointer (&self->target, g_free);
g_clear_pointer (&self->chained_target, g_free);
g_clear_pointer (&self->clean_target, g_free);
dzl_clear_pointer (&self->target, g_free);
dzl_clear_pointer (&self->chained_target, g_free);
dzl_clear_pointer (&self->clean_target, g_free);
G_OBJECT_CLASS (ide_autotools_make_stage_parent_class)->finalize (object);
}
......
......@@ -79,8 +79,8 @@ file_flags_lookup_free (gpointer data)
g_clear_object (&lookup->self);
g_clear_object (&lookup->file);
g_clear_pointer (&lookup->targets, g_ptr_array_unref);
g_clear_pointer (&lookup->relative_path, g_free);
dzl_clear_pointer (&lookup->targets, g_ptr_array_unref);
dzl_clear_pointer (&lookup->relative_path, g_free);
g_slice_free (FileFlagsLookup, lookup);
}
......@@ -89,8 +89,8 @@ file_targets_lookup_free (gpointer data)
{
FileTargetsLookup *lookup = data;
g_clear_pointer (&lookup->path, g_free);
g_clear_pointer (&lookup->mapped, g_mapped_file_unref);
dzl_clear_pointer (&lookup->path, g_free);
dzl_clear_pointer (&lookup->mapped, g_mapped_file_unref);
g_slice_free (FileTargetsLookup, lookup);
}
......@@ -1021,8 +1021,8 @@ ide_makecache_finalize (GObject *object)
g_clear_object (&self->runtime);
g_clear_object (&self->parent);
g_clear_pointer (&self->mapped, g_mapped_file_unref);
g_clear_pointer (&self->build_targets, g_ptr_array_unref);
dzl_clear_pointer (&self->mapped, g_mapped_file_unref);
dzl_clear_pointer (&self->build_targets, g_ptr_array_unref);
G_OBJECT_CLASS (ide_makecache_parent_class)->finalize (object);
......
......@@ -64,7 +64,7 @@ command_arg_clear_func (gpointer data)
g_assert (arg != NULL);
g_clear_pointer (&arg->str, g_free);
dzl_clear_pointer (&arg->str, g_free);
}
static gboolean
......@@ -389,7 +389,7 @@ add_entries_from_config_ini_file (GbBeautifierEditorAddin *self,
if (0 == g_strcmp0 (default_profile, profile))
{
*has_default = entry.is_default = TRUE;
g_clear_pointer (&default_profile, g_free);
dzl_clear_pointer (&default_profile, g_free);
}
else
entry.is_default = FALSE;
......@@ -632,7 +632,7 @@ get_entries_worker (IdeTask *task,
add_entries_from_base_path (self, user_config_path, entries, map, &ret_has_default);
has_default |= ret_has_default;
g_clear_pointer (&map, g_array_unref);
dzl_clear_pointer (&map, g_array_unref);
/* Project wide config */
if (NULL != (project = ide_context_get_project (self->context)))
......@@ -644,9 +644,9 @@ get_entries_worker (IdeTask *task,
map = gb_beautifier_config_get_map (self, configdir);
add_entries_from_base_path (self, configdir, entries, map, &ret_has_default);
has_default |= ret_has_default;
g_clear_pointer (&configdir, g_free);
dzl_clear_pointer (&configdir, g_free);
g_clear_pointer (&map, g_array_unref);
dzl_clear_pointer (&map, g_array_unref);
}
else if (NULL != (vcs = ide_context_get_vcs (self->context)))
{
......@@ -662,7 +662,7 @@ get_entries_worker (IdeTask *task,
add_entries_from_base_path (self, project_config_path, entries, map, &ret_has_default);
has_default |= ret_has_default;
g_clear_pointer (&map, g_array_unref);
dzl_clear_pointer (&map, g_array_unref);
}
}
......@@ -671,10 +671,10 @@ get_entries_worker (IdeTask *task,
map = gb_beautifier_config_get_map (self, configdir);
add_entries_from_base_path (self, configdir, entries, map, &ret_has_default);
g_clear_pointer (&configdir, g_free);
dzl_clear_pointer (&configdir, g_free);
has_default |= ret_has_default;
g_clear_pointer (&map, g_array_unref);
dzl_clear_pointer (&map, g_array_unref);
result = g_slice_new0 (GbBeautifierEntriesResult);
result->entries = g_steal_pointer (&entries);
......
......@@ -466,7 +466,7 @@ gb_beautifier_editor_addin_unload (IdeEditorAddin *addin,
gb_beautifier_helper_config_entry_remove_temp_files (self, entry);
}
g_clear_pointer (&self->entries, g_array_unref);
dzl_clear_pointer (&self->entries, g_array_unref);
}
dzl_clear_weak_pointer (&self->editor);
......@@ -474,7 +474,7 @@ gb_beautifier_editor_addin_unload (IdeEditorAddin *addin,
{
tmp_file = g_file_new_for_path (self->tmp_dir);
gb_beautifier_helper_remove_temp_for_file (self, tmp_file);
g_clear_pointer (&self->tmp_dir, g_free);
dzl_clear_pointer (&self->tmp_dir, g_free);
}
self->context = NULL;
......
......@@ -82,10 +82,10 @@ process_state_free (gpointer data)
g_clear_object (&state->tmp_src_file);
g_clear_object (&state->tmp_workdir_file);
g_clear_pointer (&state->lang_id, g_free);
g_clear_pointer (&state->text, g_free);
dzl_clear_pointer (&state->lang_id, g_free);
dzl_clear_pointer (&state->text, g_free);
g_clear_pointer (&state->command_args_strs, g_ptr_array_unref);
dzl_clear_pointer (&state->command_args_strs, g_ptr_array_unref);
g_slice_free (ProcessState, state);
}
......
......@@ -18,6 +18,7 @@
#define G_LOG_DOMAIN "c-parser"
#include <dazzle.h>
#include <string.h>
#include "c-parse-helper.h"
......@@ -27,8 +28,8 @@ parameter_free (Parameter *p)
{
if (p)
{
g_clear_pointer (&p->name, g_free);
g_clear_pointer (&p->type, g_free);
dzl_clear_pointer (&p->name, g_free);
dzl_clear_pointer (&p->type, g_free);
g_slice_free (Parameter, p);
}
}
......@@ -243,7 +244,7 @@ parse_parameters (const gchar *text)
failure:
g_slist_foreach (ret, (GFunc)parameter_free, NULL);
g_clear_pointer (&ret, g_slist_free);
dzl_clear_pointer (&ret, g_slist_free);
cleanup:
g_strfreev (parts);
......
......@@ -37,10 +37,10 @@ typedef struct
static void
clear_chunk (Chunk *chunk)
{
g_clear_pointer (&chunk->pre, g_free);
g_clear_pointer (&chunk->return_type, g_free);
g_clear_pointer (&chunk->identifier, g_free);
g_clear_pointer (&chunk->post, g_free);
dzl_clear_pointer (&chunk->pre, g_free);
dzl_clear_pointer (&chunk->return_type, g_free);
dzl_clear_pointer (&chunk->identifier, g_free);
dzl_clear_pointer (&chunk->post, g_free);
g_slist_free_full (chunk->params, (GDestroyNotify)parameter_free);
chunk->params = NULL;
}
......@@ -237,7 +237,7 @@ push_chunk (GArray *ar,
chunk.post = g_strstrip (g_strdup (str));
if (chunk.post[0] == 0)
g_clear_pointer (&chunk.post, g_free);
dzl_clear_pointer (&chunk.post, g_free);
g_array_append_val (ar, chunk);
......
......@@ -97,7 +97,7 @@ client_op_unref (ClientOp *op)
{
g_clear_object (&op->cancellable);
g_clear_object (&op->client);
g_clear_pointer (&op->id, g_variant_unref);
dzl_clear_pointer (&op->id, g_variant_unref);
g_queue_unlink (&ops, &op->link);
g_slice_free (ClientOp, op);
......
......@@ -69,9 +69,9 @@ call_free (gpointer data)
c->cancel_id = 0;
g_clear_pointer (&c->method, g_free);
g_clear_pointer (&c->params, g_variant_unref);
g_clear_pointer (&c->id, g_variant_unref);
dzl_clear_pointer (&c->method, g_free);
dzl_clear_pointer (&c->params, g_variant_unref);
dzl_clear_pointer (&c->id, g_variant_unref);
g_clear_object (&c->cancellable);
g_clear_object (&c->self);
g_slice_free (Call, c);
......@@ -157,7 +157,7 @@ ide_clang_client_subprocess_exited (IdeClangClient *self,
self->state = STATE_SPAWNING;
g_clear_object (&self->rpc_client);
g_clear_pointer (&self->seq_by_file, g_hash_table_unref);
dzl_clear_pointer (&self->seq_by_file, g_hash_table_unref);
IDE_EXIT;
}
......@@ -418,7 +418,7 @@ ide_clang_client_finalize (GObject *object)
{
IdeClangClient *self = (IdeClangClient *)object;
g_clear_pointer (&self->seq_by_file, g_hash_table_unref);
dzl_clear_pointer (&self->seq_by_file, g_hash_table_unref);
g_clear_object (&self->rpc_client);
g_clear_object (&self->root_uri);
g_clear_object (&self->supervisor);
......
......@@ -194,8 +194,8 @@ ide_clang_code_index_entries_finalize (GObject *object)
{
IdeClangCodeIndexEntries *self = (IdeClangCodeIndexEntries *)object;
g_clear_pointer (&self->entries, g_variant_unref);
g_clear_pointer (&self->path, g_free);
dzl_clear_pointer (&self->entries, g_variant_unref);
dzl_clear_pointer (&self->path, g_free);
G_OBJECT_CLASS(ide_clang_code_index_entries_parent_class)->finalize (object);
}
......
......@@ -407,8 +407,8 @@ ide_clang_completion_item_finalize (GObject *object)
self->typed_text = NULL;
g_clear_pointer (&self->results, g_variant_unref);
g_clear_pointer (&self->params, g_free);
dzl_clear_pointer (&self->results, g_variant_unref);
dzl_clear_pointer (&self->params, g_free);
G_OBJECT_CLASS (ide_clang_completion_item_parent_class)->finalize (object);
}
......
......@@ -154,9 +154,9 @@ ide_clang_proposals_finalize (GObject *object)
g_clear_object (&self->client);
g_clear_object (&self->cancellable);
g_clear_pointer (&self->filter, g_free);
g_clear_pointer (&self->match_indexes, g_array_unref);
g_clear_pointer (&self->results, g_variant_unref);
dzl_clear_pointer (&self->filter, g_free);
dzl_clear_pointer (&self->match_indexes, g_array_unref);
dzl_clear_pointer (&self->results, g_variant_unref);
G_OBJECT_CLASS (ide_clang_proposals_parent_class)->finalize (object);
}
......@@ -423,7 +423,7 @@ ide_clang_proposals_flush (IdeClangProposals *self,
if (results != self->results)
{
g_clear_pointer (&self->results, g_variant_unref);
dzl_clear_pointer (&self->results, g_variant_unref);
self->results = results ? g_variant_ref (results) : NULL;
}
......
......@@ -117,8 +117,8 @@ ide_clang_symbol_node_finalize (GObject *object)
{
IdeClangSymbolNode *self = (IdeClangSymbolNode *)object;
g_clear_pointer (&self->symbol, ide_symbol_unref);
g_clear_pointer (&self->children, g_variant_unref);
dzl_clear_pointer (&self->symbol, ide_symbol_unref);
dzl_clear_pointer (&self->children, g_variant_unref);
G_OBJECT_CLASS (ide_clang_symbol_node_parent_class)->finalize (object);
}
......
......@@ -111,7 +111,7 @@ ide_clang_symbol_tree_finalize (GObject *object)
{
IdeClangSymbolTree *self = (IdeClangSymbolTree *)object;
g_clear_pointer (&self->tree, g_variant_unref);
dzl_clear_pointer (&self->tree, g_variant_unref);
g_clear_object (&self->file);
G_OBJECT_CLASS (ide_clang_symbol_tree_parent_class)->finalize (object);
......
......@@ -65,9 +65,9 @@ G_DEFINE_TYPE (IdeClang, ide_clang, G_TYPE_OBJECT)
static void
unsaved_files_free (UnsavedFiles *uf)
{
g_clear_pointer (&uf->files, g_free);
g_clear_pointer (&uf->bytes, g_ptr_array_unref);
g_clear_pointer (&uf->paths, g_ptr_array_unref);
dzl_clear_pointer (&uf->files, g_free);
dzl_clear_pointer (&uf->bytes, g_ptr_array_unref);
dzl_clear_pointer (&uf->paths, g_ptr_array_unref);
g_slice_free (UnsavedFiles, uf);
}
......@@ -130,7 +130,7 @@ ide_clang_cook_flags (const gchar *path,
g_ptr_array_add (cooked, g_strdup (flags[i]));
if (g_strcmp0 (include, flags[i]) == 0)
g_clear_pointer (&include, g_free);
dzl_clear_pointer (&include, g_free);
}
}
......@@ -397,8 +397,8 @@ ide_clang_finalize (GObject *object)
IdeClang *self = (IdeClang *)object;
g_clear_object (&self->workdir);
g_clear_pointer (&self->unsaved_files, g_hash_table_unref);
g_clear_pointer (&self->index, clang_disposeIndex);
dzl_clear_pointer (&self->unsaved_files, g_hash_table_unref);
dzl_clear_pointer (&self->index, clang_disposeIndex);
G_OBJECT_CLASS (ide_clang_parent_class)->finalize (object);
}
......@@ -452,9 +452,9 @@ index_file_free (gpointer data)
{
IndexFile *state = data;
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
g_clear_pointer (&state->entries, g_ptr_array_unref);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->entries, g_ptr_array_unref);
g_queue_foreach (&state->decl_cursors, (GFunc)_ide_clang_dispose_cursor, NULL);
g_queue_clear (&state->decl_cursors);
......@@ -835,10 +835,10 @@ diagnose_free (gpointer data)
{
Diagnose *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
g_clear_pointer (&state->diagnostics, g_ptr_array_unref);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->diagnostics, g_ptr_array_unref);
g_clear_object (&state->workdir);
g_slice_free (Diagnose, state);
}
......@@ -1173,9 +1173,9 @@ complete_free (gpointer data)
{
Complete *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
g_slice_free (Complete, state);
}
......@@ -1369,9 +1369,9 @@ find_nearest_scope_free (gpointer data)
{
FindNearestScope *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
g_slice_free (FindNearestScope, state);
}
......@@ -1522,10 +1522,10 @@ locate_symbol_free (gpointer data)
{
LocateSymbol *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_object (&state->workdir);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
g_slice_free (LocateSymbol, state);
}
......@@ -1633,7 +1633,7 @@ ide_clang_locate_symbol_worker (IdeTask *task,
gfile = g_file_new_for_path (path);
file = ide_file_new (NULL, gfile);
g_clear_pointer (&definition, ide_symbol_unref);
dzl_clear_pointer (&definition, ide_source_location_unref);
declaration = ide_source_location_new (file, 0, 0, 0);
}
}
......@@ -1718,10 +1718,10 @@ get_symbol_tree_free (gpointer data)
{
GetSymbolTree *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_object (&state->workdir);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
g_slice_free (GetSymbolTree, state);
}
......@@ -1920,10 +1920,10 @@ get_highlight_index_free (gpointer data)
{
GetHighlightIndex *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_object (&state->workdir);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
g_slice_free (GetHighlightIndex, state);
}
......@@ -2112,9 +2112,9 @@ get_index_key_free (gpointer data)
{
GetIndexKey *state = data;
g_clear_pointer (&state->ufs, unsaved_files_free);
g_clear_pointer (&state->path, g_free);
g_clear_pointer (&state->argv, g_strfreev);
dzl_clear_pointer (&state->ufs, unsaved_files_free);
dzl_clear_pointer (&state->path, g_free);
dzl_clear_pointer (&state->argv, g_strfreev);
g_slice_free (GetIndexKey, state);
}
......
......@@ -65,7 +65,7 @@ gbp_cmake_build_target_finalize (GObject *object)
GbpCMakeBuildTarget *self = (GbpCMakeBuildTarget *)object;
g_clear_object (&self->install_directory);
g_clear_pointer (&self->name, g_free);
dzl_clear_pointer (&self->name, g_free);
G_OBJECT_CLASS (gbp_cmake_build_target_parent_class)->finalize (object);
}
......
......@@ -181,7 +181,7 @@ gbp_cmake_toolchain_provider_load_finish (IdeToolchainProvider *provider,
if (toolchains == NULL)
return FALSE;
g_clear_pointer (&self->toolchains, g_ptr_array_unref);
dzl_clear_pointer (&self->toolchains, g_ptr_array_unref);
self->toolchains = g_ptr_array_ref (toolchains);
for (guint i = 0; i < toolchains->len; i++)
......@@ -205,7 +205,7 @@ gbp_cmake_toolchain_provider_unload (IdeToolchainProvider *provider,
g_assert (GBP_IS_CMAKE_TOOLCHAIN_PROVIDER (self));
g_assert (IDE_IS_TOOLCHAIN_MANAGER (manager));
g_clear_pointer (&self->toolchains, g_ptr_array_unref);
dzl_clear_pointer (&self->toolchains, g_ptr_array_unref);
}
static void
......
......@@ -206,7 +206,7 @@ gbp_cmake_toolchain_load (GbpCMakeToolchain *self,
g_assert (GBP_IS_CMAKE_TOOLCHAIN (self));
g_clear_pointer (&self->file_path, g_free);
dzl_clear_pointer (&self->file_path, g_free);
self->file_path = g_file_get_path (file);
id = g_strconcat ("cmake:", self->file_path, NULL);
......@@ -244,7 +244,7 @@ gbp_cmake_toolchain_finalize (GObject *object)
{
GbpCMakeToolchain *self = (GbpCMakeToolchain *)object;
g_clear_pointer (&self->file_path, g_free);
dzl_clear_pointer (&self->file_path, g_free);
G_OBJECT_CLASS (gbp_cmake_toolchain_parent_class)->finalize (object);
}
......
......@@ -119,22 +119,22 @@ build_data_free (BuildData *self)
g_clear_object (&self->index_dir);
g_clear_object (&self->building_data_dir);
g_clear_object (&self->building_index_dir);
g_clear_pointer (&self->changes, g_ptr_array_unref);
dzl_clear_pointer (&self->changes, g_ptr_array_unref);
g_slice_free (BuildData, self);
}
static void
indexer_info_free (IndexerInfo *info)
{
g_clear_pointer (&info->specs, g_ptr_array_unref);
g_clear_pointer (&info->mime_types, g_ptr_array_unref);
dzl_clear_pointer (&info->specs, g_ptr_array_unref);
dzl_clear_pointer (&info->mime_types, g_ptr_array_unref);
g_slice_free (IndexerInfo, info);
}
static void
get_changes_data_free (GetChangesData *self)
{
g_clear_pointer (&self->indexers, indexer_info_free);
dzl_clear_pointer (&self->indexers, indexer_info_free);
g_clear_object (&self->data_dir);
g_clear_object (&self->index_dir);
g_clear_object (&self->vcs);
......@@ -155,7 +155,7 @@ add_entries_data_free (AddEntriesData *self)
static void
file_info_free (FileInfo *file_info)
{
g_clear_pointer (&file_info->name, g_free);
dzl_clear_pointer (&file_info->name, g_free);
g_clear_object (&file_info->directory);
g_slice_free (FileInfo, file_info);
}
......
......@@ -87,7 +87,7 @@ directory_index_free (DirectoryIndex *data)
static void
populate_task_data_free (PopulateTaskData *data)
{
g_clear_pointer (&data->query, g_free);
dzl_clear_pointer (&data->query, g_free);
for (guint i = 0; i < data->fuzzy_matches->len; i++)
{
......@@ -95,7 +95,7 @@ populate_task_data_free (PopulateTaskData *data)
g_clear_object (&(dzl_heap_index(data->fuzzy_matches, FuzzyMatch, i).match));
}
g_clear_pointer (&data->fuzzy_matches, dzl_heap_unref);
dzl_clear_pointer (&data->fuzzy_matches, dzl_heap_unref);
g_slice_free (PopulateTaskData, data);
}
......@@ -552,8 +552,8 @@ ide_code_index_index_finalize (GObject *object)
{
IdeCodeIndexIndex *self = (IdeCodeIndexIndex *)object;
g_clear_pointer (&self->directories, g_hash_table_unref);
g_clear_pointer (&self->indexes, g_ptr_array_unref);
dzl_clear_pointer (&self->directories, g_hash_table_unref);
dzl_clear_pointer (&self->indexes, g_ptr_array_unref);
g_mutex_clear (&self->mutex);
......
......@@ -89,7 +89,7 @@ ide_code_index_search_result_finalize (GObject *object)
{
IdeCodeIndexSearchResult *self = (IdeCodeIndexSearchResult *)object;
g_clear_pointer (&self->location, ide_source_location_unref);
dzl_clear_pointer (&self->location, ide_source_location_unref);
G_OBJECT_CLASS (ide_code_index_search_result_parent_class)->finalize (object);
}
......
......@@ -571,8 +571,8 @@ ide_code_index_service_stop (IdeService *service)
g_clear_object (&self->builder);
g_queue_foreach (&self->build_queue, (GFunc)build_data_unref, NULL);
g_queue_clear (&self->build_queue);
g_clear_pointer (&self->build_dirs, g_hash_table_unref);
g_clear_pointer (&self->code_indexers, g_hash_table_unref);
dzl_clear_pointer (&self->build_dirs, g_hash_table_unref);
dzl_clear_pointer (&self->code_indexers, g_hash_table_unref);
unregister_pausable (self);
}
......
......@@ -84,7 +84,7 @@ lookup_symbol_free (gpointer data)
LookupSymbol *state = data;
g_clear_object (&state->code_indexer);
g_clear_pointer (&state->location, ide_source_location_unref);
dzl_clear_pointer (&state->location, ide_source_location_unref);
g_slice_free (LookupSymbol, state);
}
......
......@@ -338,9 +338,9 @@ gb_color_picker_prefs_palette_row_finalize (GObject *object)
if (self->settings != NULL)
gb_color_picker_prefs_palette_row_disconnect (DZL_PREFERENCES_BIN (self), self->settings);
g_clear_pointer (&self->key, g_free);
g_clear_pointer (&self->target, g_variant_unref);
g_clear_pointer (&self->palette_id, g_free);
dzl_clear_pointer (&self->key, g_free);
dzl_clear_pointer (&self->target, g_variant_unref);
dzl_clear_pointer (&self->palette_id, g_free);
g_clear_object (&self->popover_menu);
G_OBJECT_CLASS (gb_color_picker_prefs_palette_row_parent_class)->finalize (object);
......
......@@ -222,7 +222,7 @@ gb_command_bar_show (GbCommandBar *self)
gtk_widget_hide (GTK_WIDGET (self->completion_scroller));
self->history_current = NULL;
g_clear_pointer (&self->saved_text, g_free);
dzl_clear_pointer (&self->saved_text, g_free);
self->saved_position_valid = FALSE;
gtk_entry_set_text (self->entry, "");
......@@ -390,7 +390,7 @@ gb_command_bar_complete (GbCommandBar *self)
}