Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Core crash when cancelling server timers
When cancelling server timers a core will crash as it is removing a timer from the map and increasing the iterator twice by calling erase() function and afterwards increasing it once again when entering a new cycle of loop. One way of solving this issue is to first collect the timers which must be removed and clean them up at the end. You can also add a simple counter which is increased at each end of the loop's cycle and remove the timer directly from the first loop by specifying the position with the counter itself.

Note that this issue seems to appear after upgrading code to C++11 or higher.

Replace the following function inside questmanager.cpp:
void CQuestManager::CancelServerTimers(DWORD arg)
        vector<pair<string, DWORD>> ServerTimersToDelete;

        for (const auto& kv : m_mapServerTimer) {
            if (kv.first.second == arg) {
                LPEVENT event = kv.second;

        // Delete all the required server timers
        for (const auto &timer : ServerTimersToDelete)

        // Clean up
Many thanks for support how I can thank you?
It is remarkable, very good message

Latest firmwares samfirm shop
link 789jksndjhwev23d34@#fgdfgh

Forum Jump:

Users browsing this thread: 1 Guest(s)