Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.
- Vacuum Dragon
- Posts: 645
- Joined: Tue Sep 30, 2014 10:01 am
I trying to figure out what the right way to fix a certain memory leak is issue-2297
So I need a feedback if the following actually is possible (else i will prune the use case as dead code):
- I encounter a savefile, read the first five bytes
- as they are not "<?xml" i try to deserialize the save game as binary
- as binary deserialization fails I try to deserialize xml-based and succeed
If that is not a real use case the code would definitely become more nice.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.
Geoff the Medio
- Programming, Design, Admin
- Posts: 12325
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
If a save file doesn't start with "<?xml" then it isn't a valid XML save file and it (probably?) wouldn't parse, and so it is not necessary to attempt to load it as one.