Fix memory leak in transparent overlay