Fix exception when close the ext-viewport of query view + history view