The dashboard you closed is still being called
transcript
Staff closed the support dashboard at six. The screen went dark. It's still being called tonight. Nothing crashed. Nothing warned. Nobody noticed.
Nine in the morning. The dashboard subscribes to orders. It wants every change. Six in the evening. It's closed. Nobody unsubscribes. Nothing throws. Next day, it's still being called. For every order.
The order keeps a list of listeners. The dashboard is on that list. A list entry is a reference. So the dashboard can't be freed. Ever. And every status change calls it again. Orders last for hours.
Closing a screen doesn't touch the order's list. The order never hears about it. So cancel the subscription when the screen closes. Make it a habit.
Weak references are a net under that rule, not the plan. In Python, you need a weak method reference. In C plus plus, a weak pointer expires the moment its last owner lets go. In JavaScript, nobody promises when. So still unsubscribe.
Whatever subscribes must unsubscribe. Otherwise, the order never forgets it.
Full breakdown in the lecture.