Problem with memory leaks was solved