I've recently been playing with Valgrind (http://developer.kde.org/~sewardj/),
which I may have mentioned before. It is a *fantastic* debugger and memory
checker. It catches all manner of mistakes, and I highly recommend it, for
any sizable project.
I've run it on Player, and it pointed out several bugs, like using new with
delete (rather than delete). It also pointed out several spots where
uninitialized memory was being accessed.
I've fixed all of these things, both on HEAD, and the patch branch.
Probably more importantly, I've added a destructor to CDevice, which frees the
data and command buffers that are allocated by the CDevice constructor. This
only happens at program exit. I think that it works, but keep an eye out for
segfaults when Player quits and please let me know about them.
I've also done the analagous thing in a P2OS destructor (the P2OS driver does
its own memory management).
At this point, much (but not all) of Player is "Valgrind-clean," which is a
Good Thing. I encourage you to try Valgrind out on Player, in particular with
drivers that you wrote or use frequently.