Port #449 Fixed access violation when closing popup