Brute force fixing the memory leak, but eh.. it works and I've lost the will to be picky