-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixes ObjectPropertyList double return issue and adds STArrayPoo…
…l debug.
- Loading branch information
1 parent
4b3b283
commit 3e69d63
Showing
3 changed files
with
70 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/************************************************************************* | ||
* ModernUO * | ||
* Copyright 2019-2023 - ModernUO Development Team * | ||
* Copyright 2019-2024 - ModernUO Development Team * | ||
* Email: [email protected] * | ||
* File: ObjectPropertyList.cs * | ||
* * | ||
|
@@ -79,8 +79,9 @@ public void Reset() | |
_stringNumbersIndex = 0; | ||
Header = 0; | ||
HeaderArgs = null; | ||
STArrayPool<char>.Shared.Return(_arrayToReturnToPool); | ||
_pos = 0; | ||
|
||
Dispose(); | ||
} | ||
|
||
private void Flush() | ||
|
@@ -499,13 +500,19 @@ private void GrowCore(uint requiredMinCapacity) | |
|
||
public void Dispose() | ||
{ | ||
STArrayPool<char>.Shared.Return(_arrayToReturnToPool); | ||
_arrayToReturnToPool = null; | ||
if (_arrayToReturnToPool != null) | ||
{ | ||
STArrayPool<char>.Shared.Return(_arrayToReturnToPool); | ||
_arrayToReturnToPool = null; | ||
} | ||
} | ||
|
||
~ObjectPropertyList() | ||
{ | ||
STArrayPool<char>.Shared.Return(_arrayToReturnToPool); | ||
_arrayToReturnToPool = null; | ||
if (_arrayToReturnToPool != null) | ||
{ | ||
STArrayPool<char>.Shared.Return(_arrayToReturnToPool); | ||
_arrayToReturnToPool = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters