Use delete[], not delete when removing arrays.