repo: Use g_new for OstreeRepoAutoLock

GSlice is effectively deprecated and has little to no advantage over
using the system allocator on Linux.
This commit is contained in:
Dan Nicholson 2021-06-07 13:14:05 -06:00
parent 5523aee082
commit 0cd9dfe815

View File

@ -678,7 +678,7 @@ ostree_repo_auto_lock_push (OstreeRepo *self,
if (!ostree_repo_lock_push (self, lock_type, cancellable, error))
return NULL;
OstreeRepoAutoLock *auto_lock = g_slice_new (OstreeRepoAutoLock);
OstreeRepoAutoLock *auto_lock = g_new (OstreeRepoAutoLock, 1);
auto_lock->repo = self;
auto_lock->lock_type = lock_type;
return auto_lock;
@ -707,7 +707,7 @@ ostree_repo_auto_lock_cleanup (OstreeRepoAutoLock *auto_lock)
errno = errsv;
g_slice_free (OstreeRepoAutoLock, auto_lock);
g_free (auto_lock);
}
}