bettola/common/src/machine.cpp
Ritchie Cunningham c052cf3cbf [Fix] Implement destructors preventing memleaks.
Fixes a bunch of memleaks related to the new Machine and VFS
architecture.

The Machine and vfs_node objects were created with 'new' but were never
properly destroyed, leading to memleaks during CoW operations and on
server shutdown.

- Added a recursive 'delete_vfs_tree' function
- Machine destructor calls this function to lean up its VFS
- CommandProcessor correctly deletes old Machine objects after a CoW
- Player destructor cleans up the player's home machine.
- NetworkManager destructor cleans up all world machines.
2025-09-27 22:18:13 +01:00

7 lines
96 B
C++

#include "machine.h"
#include "vfs.h"
Machine::~Machine(void) {
delete_vfs_tree(vfs_root);
}