Some container classes do not use a type's copy or move constructor/operator when copying or moving containers or elements. For instance, CUtlRBTree's CopyFrom method memcpys the data instead of properly copying it.
If the type in question were to contain managed memory, like CUtlString manages a char*, it will double free the memory, and may prematurely free the memory as well.
All containers should invoke the copy/move constructor/operator when initializing memory with another instance of a type, or at least warn in comments when it isn't supported.
Note that CUtlRBTree is used by CUtlMap, which is used by CUtlDict. This problem cascades into all dependent container classes.
Some container classes do not use a type's copy or move constructor/operator when copying or moving containers or elements. For instance, CUtlRBTree's CopyFrom method memcpys the data instead of properly copying it. If the type in question were to contain managed memory, like CUtlString manages a char*, it will double free the memory, and may prematurely free the memory as well.
All containers should invoke the copy/move constructor/operator when initializing memory with another instance of a type, or at least warn in comments when it isn't supported.
Note that CUtlRBTree is used by CUtlMap, which is used by CUtlDict. This problem cascades into all dependent container classes.