Closed iamgreaser closed 9 years ago
Started implementing this. It's actually easier than I thought, although it's a little bit tedious.
pmf/wav/img garbage collection implemented. TODO: map/mus GC. Maps should be easy, but the music will require some care.
OK, this apparently is mostly in there, although maps and music I don't really care all that much about wrt GC.
Crash bugs in 0.1.2-10 have been fixed after some rather serious valgrind sessions.
Should I just close this?
What's the trouble with GCing music? And maps should be easy, surely? Can there be more than one?
Close it if you think it's unnecessary though; I doubt anyone else is going to get around to it any time soon.
I've found that freeing music tends to be a bit unstable. But the thing is, there really isn't much point in GCing music and maps other than consistency - there's very few of the damn things loaded, and you generally don't unload them (aside from maps, but there's usually only one going at a time anyway).
See #67 .
For the maps, I was wondering about when a server changes map. If the old one just hangs around, that would be an issue. Sounds, while not really an issue for the base game, could be problematic for custom servers, so an eventual fix would be good.
I'm talking about garbage collection - common.map_free() and common.mus_free() both still exist and still do things.
Right, yeah, derp. That's not an issue for maps, and I guess anything that does any weird shit with a ton of music can free it itself.
Closing because it's pretty easy to free maps and music by hand... although I'm genuinely not sure about the music but yeah.
This would save us a LOT of grief, mostly pertaining to memory leaks and whatnot.
More research is necessary. I think we need to have some metatable shit in there.