1) some errors detected in eraseFromGSVector (as i have 2 components in vector, use second and then erase it, when i run through vector, only second(not first) component is inside)
2) i have a trouble with analog of yours
scheduleTask = (SCHEDULETASK*)(getFromGSVector(scheduler,i));
function craches when i run second loop (looking like we need to remove scheduleTask after first loop)