Closed retrooper closed 2 years ago
We should make a method called makeResuable() or so in the wrapper to simplify this task. So users dont need to interact with netty directly.
Should the user call makeReusable before every use of the Wrapper, or only once and let them clean up the buffer's memory once they don't need it anymore or we just leave the buffer's memory lingering (this would probably be pretty bad)?
Idek, you tell me how we do it. Just sometimes people want to send one packet wrapper to a set of users without re-encoding it each time. You know?
Fixed by https://github.com/retrooper/packetevents/commit/16f9eb32c9fddb911b296c33de28ac229be88eaf
It does have to re-encode it every time, but I don't trust users enough to not memory leak to give them that ability.
Basically, we likely need to do some buffer retain duplication.