BUG: fixed memory leak when iterating over CArrays/EArrays (#308)