Your code is incomplete and scrambled. Are you sure you don't have a loop terminating condition that can't occur? (i.e. an infinite loop). How many polygons are you drawing?
You could put in some logging to verify that the code does what you expect.
You could put in an early termination to the loop and use OS facilities to check memory usage to see if a leak (i.e. pack-ratting) is occurring.
RedGrittyBrick
2010-10-25 16:39:39