In order to respond to Alt+E by putting a prompt at the bottom of the
current activity (rather than the naïve approach of breaking the
keypress into ESC + E, switching to the utilities menu in response to
the ESC, and then putting the prompt at the bottom of that much less
helpful screen), we remember an activity from the start of the overall
keypress, in the 'initial_util' field of ActivityStack.
But then we _leave_ it there, and don't clean it up - which means it's
returned by ActivityStack::iter(), and hence inhibits garbage
collection of the associated activity state. So a thing could linger
in there for ages despite not actually being on the stack.
self.initial_util = self.util.clone();
}
+ pub fn completed_event(&mut self) {
+ // At the end of an event, clear initial_util again.
+ self.initial_util = None;
+ }
+
pub fn goto(&mut self, act: Activity) {
match act {
Activity::Util(x) => {
PhysicalAction::Nothing => (),
}
}
+
+ self.state.completed_event();
}
}
self.activity_stack.new_event();
}
+ fn completed_event(&mut self) {
+ self.activity_stack.completed_event();
+ self.gc_activity_states();
+ }
+
fn handle_keypress(
&mut self,
key: OurKey,