Fixed a memory leak which is related to value types (when server is getting killed.)