Fix #6169. variable was defined in class but treated as local to function in parts. This meant it wasn't being cleared properly when view was recreated (eg. changing language).