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

cpp: Ensure that Trees::tree reuses our reference counter #367

Closed
wants to merge 1 commit into from

Conversation

jktjkt
Copy link
Contributor

@jktjkt jktjkt commented Oct 4, 2016

The code uses Counter instances to work around the std::shared_ptr API
design where one cannot really manipulate the reference count from
outside. In this context, we however need to ensure that a
shared_ptr created from within a Trees context reuses the same
counter, and that the underlying data structure only gets deleted when
the enclosing Trees structure is destroyed.

@mislavn , please check issue #366 and ensure that this patch doesn't make the situation worse.

The code uses Counter instances to work around the std::shared_ptr API
design where one cannot really manipulate the reference count from
outside. In this context, we however need to ensure that a
shared_ptr<Tree> created from within a Trees context reuses the same
counter, and that the underlying data structure only gets deleted when
the enclosing Trees structure is destroyed.

Cc issue sysrepo#366
@codecov-io
Copy link

codecov-io commented Oct 5, 2016

Current coverage is 85.86% (diff: 100%)

Merging #367 into devel will increase coverage by 0.90%

@@              devel       #367   diff @@
==========================================
  Files            29         29           
  Lines         18280      20187   +1907   
  Methods         770        948    +178   
  Messages          0          0           
  Branches       3130       3720    +590   
==========================================
+ Hits          15532      17333   +1801   
- Misses         2748       2854    +106   
  Partials          0          0           

Powered by Codecov. Last update 74b6836...b04250d

@rastislavs
Copy link
Contributor

fixed in #375
Thanks!

@rastislavs rastislavs closed this Oct 5, 2016
@jktjkt jktjkt deleted the cpp-trees branch October 7, 2016 15:47
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.

None yet

3 participants