Just to make it clear: by adding something to a ScopedVector you know that the ScopedVector will delete the elements when it goes out of scope. I also realized that there are several places in the code that we should have been using ScopedVector but we are doing delete + clear().