Skip to content

Commit 1137ea1

Browse files
committed
Fix double ref increment for misc Repository C++ APIs
Noticed these when reviewing the Rust Repository API
1 parent 6106226 commit 1137ea1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pluginmanager.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ vector<Ref<RepoPlugin>> Repository::GetPlugins() const
288288

289289
Ref<RepoPlugin> Repository::GetPluginByPath(const string& pluginPath)
290290
{
291-
return new RepoPlugin(BNNewPluginReference(BNRepositoryGetPluginByPath(m_object, pluginPath.c_str())));
291+
return new RepoPlugin(BNRepositoryGetPluginByPath(m_object, pluginPath.c_str()));
292292
}
293293

294294
string Repository::GetFullPath() const
@@ -335,10 +335,10 @@ bool RepositoryManager::AddRepository(const std::string& url,
335335

336336
Ref<Repository> RepositoryManager::GetRepositoryByPath(const std::string& repoPath)
337337
{
338-
return new Repository(BNNewRepositoryReference(BNRepositoryGetRepositoryByPath(m_object, repoPath.c_str())));
338+
return new Repository(BNRepositoryGetRepositoryByPath(m_object, repoPath.c_str()));
339339
}
340340

341341
Ref<Repository> RepositoryManager::GetDefaultRepository()
342342
{
343-
return new Repository(BNNewRepositoryReference(BNRepositoryManagerGetDefaultRepository(m_object)));
343+
return new Repository(BNRepositoryManagerGetDefaultRepository(m_object));
344344
}

0 commit comments

Comments
 (0)