Fix memory leak of array view