Properly free pdata structures.