Browse Source

crashfix-string deconstructor
validate we aren't either empty or using the reserved empty string before we release the pointed to value (as a note, the latter at least shouldn't have been required, but might as well be paranoid about it)

AzaezelX 5 years ago
parent
commit
81a4e47235
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Engine/source/core/util/str.cpp

+ 2 - 1
Engine/source/core/util/str.cpp

@@ -590,7 +590,8 @@ String::String(const UTF16 *str)
 
 
 String::~String()
 String::~String()
 {
 {
-   _string->release();
+   if (_string && _string != StringData::Empty())
+      _string->release();
 }
 }
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------