There are even languages with deterministic destruction which solves nearly all resource leak problems, and at least one of them is directly compatible with C and has nice metaprogramming facilities. C++ it is.