+/* When the window is about to close, stop its animation.
+ Without this, timers might fire after the window is dead.
+ */
+- (void)windowWillClose:(NSNotification *)notification
+{
+ NSWindow *win = [notification object];
+ NSView *cv = win ? [win contentView] : 0;
+ ScreenSaverView *sv = cv ? find_saverView (cv) : 0;
+ if (sv && [sv isAnimating])
+ [sv stopAnimation];
+}
+