Seeing constructs in window

Hi everyone, I’ve been trying to replicate some examples from the Coding Train on YouTube. I’m copying the code here for the one that’s giving me trouble. Btw I’m using macOS 10.15.3 and Xcode 11.6.

I’m basically setting up a loop that creates a bunch of objects, in order to draw circles with the information in those objects. If I don’t limit the loop somehow, I see flashes on my window. I suspect those flashes are circles rendering with garbage values. But I find this constructs happen too often. How can I deal with this?

If you watch the .gif I’ve attached, you can see the flashes at the start. That’s when the particle creation is running without reaching my 2000 limit. Thank you in advance.

std::vector<Mover> v;

//--------------------------------------------------------------
void ofApp::setup(){
    ofSetWindowShape(600, 600);
    ofBackground(255);
    ofSetFrameRate(60);
}

//--------------------------------------------------------------
void ofApp::update(){
    if (v.size() < 2000) {
        v.push_back(Mover());
    }

    for (Mover& i : v) {
        ofVec3f gravity = ofVec3f(0.0, 0.4);
        i.applyForce(gravity);

        ofVec3f randomAcc = ofVec3f(ofRandom(-0.5, 0.5), ofRandom(-0.5, 0.0));
        i.applyForce(randomAcc);

        i.update();
    }
}
//--------------------------------------------------------------
void ofApp::draw(){
    for (int i = v.size(); i > 0; i--) {
        Mover m = v[i];
        m.draw();

        if (m.isDead() && v.size() >= 2000) {
            v.erase(v.begin() + i - 1);
        }
    }
}
class Mover {
    public:
        ofVec3f location;
        ofVec3f velocity;
        ofVec3f acceleration;
        float mass;
        float lifespan;

        Mover();
        Mover(float x, float y, float mass);
        void update();
        void draw();
        void applyForce(ofVec3f force);
        bool isDead();
};
Mover::Mover() {
    location = ofVec3f(ofGetWidth()/2, 50.0, 0.0);
    velocity = ofVec3f(0.0, 0.0, 0.0);
    acceleration = ofVec3f(0.0, 0.0, 0.0);
    mass = 5.0;
    lifespan = 100.0;
}
void Mover::update() {
    location = location + velocity;
    velocity = velocity + acceleration;
    acceleration = acceleration * 0;
}

void Mover::draw() {
    ofEnableAlphaBlending();
    float height = ofGetHeight();
    lifespan = 100 - ofMap(location.y, 0.0, height, 0, 100);
    ofSetColor(0, 0, 0, lifespan);
    ofDrawCircle(location.x, location.y, mass);
    ofDisableAlphaBlending();
}
void Mover::applyForce(ofVec3f f) {
    ofVec3f netForce = f / mass;
    acceleration += netForce;
}

bool Mover::isDead() {
    return lifespan <= 0.0;
}

Untitled