[PR #22] [CLOSED] Fixed ProtoWriter's implementation of IDisposable #940

Closed
opened 2026-02-27 15:52:32 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/quasar/Quasar/pull/22
Author: @yankejustin
Created: 3/17/2015
Status: Closed

Base: masterHead: master


📝 Commits (7)

  • 2fd2001 Merge pull request #1 from MaxXor/master
  • be23359 Dispose of MemoryStream
  • 9a10e2f Correctly implemented IDisposable
  • ba2f2a0 Correctly implemented IDisposable
  • 8605b37 Minor change
  • 245fb58 Merge pull request #2 from MaxXor/master
  • 1bed145 Reflected changes to ProtoBuf classes

📊 Changes

4 files changed (+160 additions, -48 deletions)

View changed files

📝 Client/Core/ProtoBuf/BufferExtension.cs (+20 -15)
📝 Client/Core/ProtoBuf/ProtoWriter.cs (+64 -10)
📝 Server/Core/ProtoBuf/BufferExtension.cs (+20 -15)
📝 Server/Core/ProtoBuf/ProtoWriter.cs (+56 -8)

📄 Description

Correctly implemented IDisposable on the client's and server's ProtoWriter. This will cause its behavior to be more reliable.
Notable:

  1. Original implementation did not suppress finalization (hitting performance a bit).
  2. Original implementation specified that it did not want to dispose of the underlying Stream for the ProtoWriter in the comments, but removed the reference to the underlying Stream by setting the Stream to null, causing a memory leak and losing control of the underlying Stream.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/quasar/Quasar/pull/22 **Author:** [@yankejustin](https://github.com/yankejustin) **Created:** 3/17/2015 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (7) - [`2fd2001`](https://github.com/quasar/Quasar/commit/2fd20010570c6a3619a90d499ceb41989cd6a42a) Merge pull request #1 from MaxXor/master - [`be23359`](https://github.com/quasar/Quasar/commit/be233599dbff9e279bd168cd404e2c20cd99c23d) Dispose of MemoryStream - [`9a10e2f`](https://github.com/quasar/Quasar/commit/9a10e2f99293dcfa9bf807e32e82d760d2c9aae9) Correctly implemented IDisposable - [`ba2f2a0`](https://github.com/quasar/Quasar/commit/ba2f2a0b2a8b54813d7e84a20ce861bfee1bf8dc) Correctly implemented IDisposable - [`8605b37`](https://github.com/quasar/Quasar/commit/8605b37f6113e03538f473f5787b8a62d97fde46) Minor change - [`245fb58`](https://github.com/quasar/Quasar/commit/245fb58ad438793cd3efb06242a4987156c9464d) Merge pull request #2 from MaxXor/master - [`1bed145`](https://github.com/quasar/Quasar/commit/1bed14532ccd51590ec9d6771a8b1152133a2a20) Reflected changes to ProtoBuf classes ### 📊 Changes **4 files changed** (+160 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `Client/Core/ProtoBuf/BufferExtension.cs` (+20 -15) 📝 `Client/Core/ProtoBuf/ProtoWriter.cs` (+64 -10) 📝 `Server/Core/ProtoBuf/BufferExtension.cs` (+20 -15) 📝 `Server/Core/ProtoBuf/ProtoWriter.cs` (+56 -8) </details> ### 📄 Description Correctly implemented IDisposable on the client's and server's ProtoWriter. This will cause its behavior to be more reliable. Notable: 1) Original implementation did not suppress finalization (hitting performance a bit). 2) Original implementation specified that it did not want to dispose of the underlying Stream for the ProtoWriter in the comments, but removed the reference to the underlying Stream by setting the Stream to null, causing a memory leak and losing control of the underlying Stream. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 15:52:32 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Quasar#940
No description provided.