Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unlink libsolv repo when libdnf:Repo: detachLibsolvRepo #759

Closed

Conversation

j-mracek
Copy link
Contributor

@j-mracek j-mracek commented Jul 8, 2019

it should prevent from calling of libsolv repo after deallocation of
Sack and Pool.

@@ -1345,8 +1345,9 @@ void Repo::Impl::attachLibsolvRepo(LibsolvRepo * libsolvRepo)
void Repo::Impl::detachLibsolvRepo()
{
libsolvRepo->appdata = nullptr;
this->libsolvRepo = nullptr;
if (--nrefs > 0)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be rewritten to:

if (--nrefs <= 0)
    delete owner;

it should prevent from calling of libsolv repo after deallocation of
Sack and Pool.

https://bugzilla.redhat.com/show_bug.cgi?id=1727424
@dmach
Copy link

dmach commented Jul 12, 2019

It did not fix the problem. @jrohel should have a better patch.
The repo implementation in libdnf is pretty twisted and needs a serious rewrite :(

@dmach dmach closed this Jul 12, 2019
@dmach dmach self-assigned this Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants