[gnome-builder: 4/6] fixed leaks and stick to format
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder: 4/6] fixed leaks and stick to format
- Date: Sat, 4 Jul 2020 18:09:22 +0000 (UTC)
commit 555fe18265b94175d4a93c05080fa94d3fcc7f50
Author: Günther Wagner <info gunibert de>
Date: Thu Jul 2 22:00:59 2020 +0200
fixed leaks and stick to format
src/plugins/rust-analyzer/rust-analyzer-service.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/rust-analyzer/rust-analyzer-service.c
b/src/plugins/rust-analyzer/rust-analyzer-service.c
index 7e6a810ea..d42c3cd04 100644
--- a/src/plugins/rust-analyzer/rust-analyzer-service.c
+++ b/src/plugins/rust-analyzer/rust-analyzer-service.c
@@ -114,7 +114,8 @@ rust_analyzer_service_get_current_file (RustAnalyzerService *self)
surface = ide_workspace_get_surface_by_name (workspace, "editor");
page = ide_editor_surface_get_active_page (IDE_EDITOR_SURFACE (surface));
- if (!IDE_IS_EDITOR_PAGE (page)) return NULL;
+ if (!IDE_IS_EDITOR_PAGE (page))
+ return NULL;
IDE_RETURN (g_object_ref (ide_editor_page_get_file (IDE_EDITOR_PAGE (page))));
}
@@ -155,16 +156,20 @@ rust_analyzer_service_determine_workdir (RustAnalyzerService *self)
g_autoptr(GFile) parent = NULL;
current_file = rust_analyzer_service_get_current_file (self);
- if (current_file == NULL) goto end;
+ if (current_file == NULL)
+ goto end;
parent = g_file_get_parent (current_file);
while (!g_file_equal (workdir, parent))
{
+ GFile *prev_parent = NULL;
if (rust_analyzer_service_search_cargo_root (self, parent))
{
return g_steal_pointer (&parent);
}
+ prev_parent = parent;
parent = g_file_get_parent (parent);
+ g_object_unref (prev_parent);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]