mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix utlvector and utlstring destructor bug
Fix duplicate call to CUtlMemory<T>::Purge. This was caused due to an extra call performed in the destructor of CUtlVector and CUtlString. Disassembling the DLL after performing these changes revealed the destructor of the allocator is only getting called once now; the issue has been fixed.
This commit is contained in:
parent
629b7cd8a2
commit
c02e738866
@ -32,15 +32,6 @@ public:
|
||||
#else
|
||||
m_nActualLength = 0;
|
||||
#endif
|
||||
|
||||
// Has to be explicitly called due to the
|
||||
// current design of our SDK. Unlike other
|
||||
// Source Engine games, we couldn't import
|
||||
// the memalloc singleton as the executable
|
||||
// is monolithic; we obtain it post init
|
||||
// (too late for binding it against the
|
||||
// new/delete operators..).
|
||||
m_Memory.~CUtlMemory();
|
||||
}
|
||||
|
||||
// NOTE: nInitialLength indicates how much of the buffer starts full
|
||||
|
@ -648,7 +648,8 @@ inline CUtlVector<T, A>::CUtlVector(T* pMemory, int allocationCount, int numElem
|
||||
template< typename T, class A >
|
||||
inline CUtlVector<T, A>::~CUtlVector()
|
||||
{
|
||||
Purge();
|
||||
RemoveAll();
|
||||
// Destructor of allocator calls purge.
|
||||
}
|
||||
|
||||
template< typename T, class A >
|
||||
|
Loading…
x
Reference in New Issue
Block a user