fix memory leak for memory views in extension subtypes
merge 0.20.x branch into master