Fixed memory leak that occurred when deleting empty folders