tree-wide: Convert to using autoptr(GString) vs g_string_free(...,TRUE)
If we're freeing the segment, it's basically always better to use `autoptr()`. Fewer lines, more reliable, etc. Noticed an instance of this in the pull code while reviewing a different PR, decided to do a grep for it and fix it tree wide. Closes: #836 Approved by: pwithnall
This commit is contained in:
1 parent
bf9772f231
commit
712bf21914
13 files changed
+21
-63
No files matched your search
@@ -3474,8 +3474,8 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||
bytes_transferred = _ostree_fetcher_bytes_transferred (pull_data->fetcher);
|
||||
if (bytes_transferred > 0 && pull_data->progress)
|
||||
{
|
||||
guint shift;
|
||||
GString *buf = g_string_new ("");
|
||||
guint shift;
|
||||
g_autoptr(GString) buf = g_string_new ("");
|
||||
|
||||
/* Ensure the rest of the progress keys are set appropriately. */
|
||||
update_progress (pull_data);
|
||||
@@ -3499,7 +3499,6 @@ ostree_repo_pull_with_options (OstreeRepo *self,
|
||||
(guint) ((end_time - pull_data->start_time) / G_USEC_PER_SEC));
|
||||
|
||||
ostree_async_progress_set_status (pull_data->progress, buf->str);
|
||||
g_string_free (buf, TRUE);
|
||||
}
|
||||
|
||||
/* iterate over commits fetched and delete any commitpartial files */
|
||||
|
||||
Reference in new issue
Block a user