[fix] Try to fix memory leaks on Ubuntu