A couple of days back, I sat down to do one of these posts and I hit a brick wall. I was getting, well, here's the error:
Exception calling "tick" with "0" argument(s): "Collection was modified; enumeration operation may not execute."
This is the same error I was getting when I was removing objects from the computer queue during a foreach loop. I didn't understand why it was happening again because I wasn't removing anything from a list, so it shouldn't have invalidated an enumeration action.
But then I read on-line that some list classes have a “dirty” flag – and my code has the following line:
c.Free = false;
And if I comment this line out, the error doesn't happen. (although that messes up other stuff.)
So, I might be able to fix it by implementing it as a for-loop.
And it still doesn't work.
Well, I'll have to figure it out next time.
No comments:
Post a Comment