Skip to content

ofxThreadedVideoNullCommand instantiated? #8

Description

@borg

Are you sure ofxThreadedVideoNullCommand is instantiated? It is declared in ofxThreadedVideo.h but I think static variables need to be instantiated in the body file, no? They are a bit odd I think. Not sure why its a global static and not a class variable, but making following change seems to have fixed the issue with null ofxThreadedVideoNullCommand. Have yet to test thoroughly.

static ofxThreadedVideoCommand ofxThreadedVideoNullCommand;

Got a crash on line

ofxThreadedVideoCommand ofxThreadedVideo::getCommand(){
>>> return ofxThreadedVideoNullCommand;

Turned it into a class static variable

class ofxThreadedVideo : public ofThread {

public:
    static ofxThreadedVideoCommand ofxThreadedVideoNullCommand;
}
#include "ofxThreadedVideo.h"
ofxThreadedVideoCommand ofxThreadedVideo::ofxThreadedVideoNullCommand;


ofxThreadedVideoCommand ofxThreadedVideo::getCommand(){
    if(ofxThreadedVideoCommands.size() > 0){
        return ofxThreadedVideoCommands.front();
    }else{
        return ofxThreadedVideo::ofxThreadedVideoNullCommand;
    }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions