This is not how software development work. You have to put barriers in your software so memory leaks never happen.