mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-05 18:24:12 +00:00
remove usage of xmldoc as a ptr (#1538)
resolves a memory leak in BrickDatabase, adds stability to character save doc. Tested that saving manually via force-save, logout and /crash all saved my position and my removed banana as expected. The doc was always deleted on character destruction and on any updates, so this is just a semantic change (and now we no longer have new'd tinyxml2::documents on the heap)
This commit is contained in:
@@ -37,7 +37,7 @@ public:
|
||||
void LoadXmlRespawnCheckpoints();
|
||||
|
||||
const std::string& GetXMLData() const { return m_XMLData; }
|
||||
tinyxml2::XMLDocument* GetXMLDoc() const { return m_Doc; }
|
||||
const tinyxml2::XMLDocument& GetXMLDoc() const { return m_Doc; }
|
||||
|
||||
/**
|
||||
* Out of abundance of safety and clarity of what this saves, this is its own function.
|
||||
@@ -623,7 +623,7 @@ private:
|
||||
/**
|
||||
* The character XML belonging to this character
|
||||
*/
|
||||
tinyxml2::XMLDocument* m_Doc;
|
||||
tinyxml2::XMLDocument m_Doc;
|
||||
|
||||
/**
|
||||
* Title of an announcement this character made (reserved for GMs)
|
||||
|
Reference in New Issue
Block a user