Changeset 419fa2


Ignore:
Timestamp:
Jan 30, 2015, 1:53:24 PM (10 years ago)
Author:
Frederik Heber <heber@…>
Children:
6bbdfb
Parents:
7e6c0d
Message:

tempcommit: Fixing access to clearQueue() which deadlocked before.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/Actions/ActionQueue.cpp

    r7e6c0d r419fa2  
    205205        pushStatus("FAIL: Action "+*boost::get_error_info<ActionNameString>(e)+" has failed.");
    206206        World::getInstance().setExitFlag(5);
    207         clearQueue(CurrentAction);
    208         clearTempQueue();
    209207        lastActionOk = false;
    210208        std::cerr << "Remaining Actions cleared from queue." << std::endl;
     
    212210        pushStatus("FAIL: General exception caught, aborting.");
    213211        World::getInstance().setExitFlag(134);
    214         clearQueue(CurrentAction);
    215         clearTempQueue();
    216212        std::cerr << "Remaining Actions cleared from queue." << std::endl;
    217213      }
     
    219215      const Action *lastaction = actionqueue[CurrentAction];
    220216      // step on to next action and check for end
    221       CurrentAction++;
     217      if (lastActionOk)
     218        CurrentAction++;
    222219      // insert new actions (before [CurrentAction]) if they have been spawned
    223220      // we must have an extra vector for this, as we cannot change actionqueue
    224221      // while an action instance is "in-use"
    225222      mtx_actionqueue.unlock();
     223
     224      if (!lastActionOk) {
     225        clearQueue(CurrentAction);
     226        clearTempQueue();
     227      }
    226228
    227229      insertTempQueue();
Note: See TracChangeset for help on using the changeset viewer.