DarkflameUniverse / DarkflameServer

The main repository for the Darkflame Universe Server Emulator project.
https://www.darkflameuniverse.org/
GNU Affero General Public License v3.0
647 stars 172 forks source link

chore: remove usage of xmldoc as a ptr #1538

Closed EmosewaMC closed 6 months ago

EmosewaMC commented 6 months ago

resolves a possible memory leak in BrickDatabase, adds stability to character save doc as it can now no longer be null (and given the context of when UpdateXml would is called, it cannot be a stale reference either since an entity must exist in order to save and LoadFromXml).

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)