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

Update to 1.20.6 #242

Merged
merged 8 commits into from
May 5, 2024
Merged

Update to 1.20.6 #242

merged 8 commits into from
May 5, 2024

Conversation

acikek
Copy link
Contributor

@acikek acikek commented May 3, 2024

Depends on CottonMC/Jankson-Fabric#23 (or similar)

For the new networking paradigm, I chose to keep the extra PacketByteBuf data intact to preserve API. A much more robust system would be to use PacketCodecs for that system as well


if (receiver != null) {
buf.retain();
data.buf().retain();
Copy link
Member

Choose a reason for hiding this comment

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

Since the buffer is now created by us, I think this extra retain might leak memory:

  • Initial state: refcount = 1
  • retain: refcount = 2
  • release: refcount = 1 (needs 0 to be deallocated according to Netty ReferenceCounted docs)

Copy link
Member

@Juuxel Juuxel left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! It still has some issues, but I'll fix those myself before publishing.

@Juuxel Juuxel merged commit 73d08c0 into CottonMC:master May 5, 2024
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