Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

fix: make closing the in-memory peerstore actually close it #131

Merged
merged 2 commits into from
Mar 23, 2020

Conversation

Stebalien
Copy link
Member

Reference pstoremem components by pointer to:

  1. Avoid copying locks around on construction.
  2. Avoid copying these around when calling weakClose.
  3. Ensures that they all implement the io.Closer interface (it's implemented on the pointer, not the value).

Technically, we could have just taken a reference when calling weakClose, but this is cleaner.

Also, add a leak test.

Reference pstoremem components by pointer to:

1. Avoid copying locks around on construction.
2. Avoid copying these around when calling `weakClose`.
3. Ensures that they all implement the `io.Closer` interface (it's implemented
on the pointer, not the value).

Technically, we could have just taken a reference when calling `weakClose`, but
this is cleaner.
@Stebalien Stebalien requested a review from yusefnapora March 23, 2020 21:18
Copy link
Contributor

@yusefnapora yusefnapora left a comment

Choose a reason for hiding this comment

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

nice!

@Stebalien Stebalien merged commit 0860fe0 into master Mar 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants