  #include "selfdrive/ui/replay/replay.h"
  
  const QString DEMO_ROUTE = "4cf7a6ad03080c90|2021-09-29--13-46-36";
  struct termios oldt = {};
  Replay *replay = nullptr;
  
  void sigHandler(int s) {
    std::signal(s, SIG_DFL);
    if (oldt.c_lflag) {
      tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
 
</s> remove   if (replay) {
    replay->stop();
  }
 </s> add  </s> remove   void stop();
 </s> add  </s> remove   replay = new Replay(route, allow, block, nullptr, replay_flags, parser.value("data_dir"), &app);
 </s> add   Replay *replay = new Replay(route, allow, block, nullptr, replay_flags, parser.value("data_dir"), &app); </s> remove   stop();
}

void Replay::stop() {
 </s> add 
  #include "selfdrive/ui/replay/replay.h"
  
  const QString DEMO_ROUTE = "4cf7a6ad03080c90|2021-09-29--13-46-36";
  struct termios oldt = {};

  
  void sigHandler(int s) {
    std::signal(s, SIG_DFL);
    if (oldt.c_lflag) {
      tcsetattr(STDIN_FILENO, TCSANOW, &oldt);
keep keep keep keep replace keep keep keep keep keep
 replay: fix segfault or hanging on quit (#23323) 
selfdrive/ui/replay/main.cc