On Mon, Sep 21, 2009 at 8:37 PM, Kai Sterker <kai.ster...@gmail.com> wrote:
> As of yesterday, all code has been committed. [...] > However, it is not well tested yet, so this will be something to work > on today. Took me nearly a week to figure out a segfault I was getting in serializertest.py :-(. Turns out that the serializer object was deleted by Python, after being passed to the savegame manager. Accessing it afterwards then caused the crash. I fixed this behaviour using a typemap in the SWIG interface, but in general there is the question how to handle memory management for the serializers. Does the savegame stuff take ownership and responsibility for cleaning up? Or remains ownership with the instances that register stuff at the savegame manager? Former will be fine if registrations are (mostly) static, but if we start registering/deregistering serializers frequently, then ownership should not belong to the savegame manager. This requires some additional thoughts ... Anyway, to try things out, you can do something like: python serializertest.py -g . data The invocation is getting a bit complicated, as I changed the engine initialization routine to exit if it does not find the builtin or a user-supplied data directory. Plus, the savegame stuff will only be initialized properly if a game name is given ... in this case it's 'data'. Feel free to experiment a bit with serializertest.py too. The underlying code should be pretty solid by now, but there might still be issues left. Cheers, Kai _______________________________________________ Adonthell-devel mailing list Adonthell-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/adonthell-devel