Skip to content

std::out_of_range when accessing SaveTrafficData object #16

Description

@shmocz

ServiceData objects are deinitialized in ExitGameLoop hook:

ra2yrcpp/src/hooks_yr.cpp

Lines 388 to 400 in 21491da

DEFINE_HOOK(0x72dfb0, ExitGameLoop, 0x6) {
(void)R;
auto [mut, M] = MainData::acquire();
GameCommandData::get()->game_state()->set_stage(
ra2yrproto::ra2yr::STAGE_EXIT_GAME);
M->deinitialize_service_datas();
// Flush output in case the process is not terminated gracefully.
std::cerr << std::flush;
std::cout << std::flush;
return 0U;
}

However, calls to TunnelSendTo and TunnelRecvFrom are still happening, causing std::out_of_range to be thrown in the respective hooks.

Solution is to perform ServiceData deinitialization elsewhere when tunnel related recvs/sends are no longer occurring.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions