MemLeak fixed, VS12 support

MemLeak fixed, VS12 support