We really shouldn't be doing this, but something about freeing KeyValues is causing issues.
@@ -118,8 +118,6 @@ bool CEconManager::InsertOrReplaceAttribute(KeyValues *pAttribKV) {
}
bool CEconManager::RegisterAttribute(KeyValues* pAttribKV) {
- // for some reason any KV pointers we store blows up
- // don't have the energy to deal with this shit
AutoKeyValues kv{pAttribKV->MakeCopy()};
std::string attrName = kv->GetString("name");
this->m_RegisteredAttributes[attrName] = std::move(kv);
@@ -53,9 +53,10 @@ class AutoKeyValues {
AutoKeyValues(const AutoKeyValues &other) : m_pKeyValues{other.m_pKeyValues->MakeCopy()} {}
~AutoKeyValues() {
- if (m_pKeyValues) {
- m_pKeyValues->deleteThis();
- }
+ // TODO: figure out why doing this blows up the server
+ // if (m_pKeyValues) {
+ // m_pKeyValues->deleteThis();
+ // }
KeyValues *operator->() const { return m_pKeyValues; }