File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,18 @@ fn run() -> Result<(), Error> {
5050 paths_from ( input) ?,
5151 Interaction :: Full ,
5252 ) ?
53- . map ( |( keys_rx, mut app) | app. process_events ( & mut terminal, keys_rx. into_iter ( ) ) ) ;
53+ . map ( |( keys_rx, mut app) | {
54+ let res = app. process_events ( & mut terminal, keys_rx. into_iter ( ) ) ;
55+ // Leak app memory to avoid having to wait for the hashmap to deallocate, which causes a noticable delay shortly before the the
56+ // program exits anyway.
57+ std:: mem:: forget ( app) ;
58+ res
59+ } ) ;
5460
5561 drop ( terminal) ;
5662 io:: stdout ( ) . flush ( ) . ok ( ) ;
5763
58- // Exit 'quickly' to avoid having to wait for all memory to be freed by us.
59- // Let the OS do it - we have nothing to lose, literally.
64+ // Exit 'quickly' to avoid having to not have to deal with slightly different types in the other match branches
6065 std:: process:: exit ( res. transpose ( ) ?. map ( |e| e. to_exit_code ( ) ) . unwrap_or ( 0 ) ) ;
6166 }
6267 Some ( Aggregate {
You can’t perform that action at this time.
0 commit comments