Mutlithread, memory pool
Fixed some memory leaks