Avoids memory leak.