Fixing view registry memory leak