BString: rewrite cleanup methods
This removes the use of the destructor in the move assignment operator, as it may rely on undefined behaviour from the compiler. Additionally, some duplicate logic to dereference and free a shared string has been unified under _ReleasePrivateData(). Change-Id: Ie9f51d598c734f83cd0fba49b651315c6e9c8aac Reviewed-on: https://review.haiku-os.org/c/haiku/+/4440 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
@@ -423,6 +423,7 @@ private:
|
||||
const int32& _ReferenceCount() const;
|
||||
bool _IsShareable() const;
|
||||
void _FreePrivateData();
|
||||
void _ReleasePrivateData();
|
||||
|
||||
char* fPrivateData;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user