I’m using a thread to fetch images via HTTP using ofxFileLoader.loadFromUrl. But after the software is running for a couple of hours I always get this same error:
EXC_BAD_ACCESS
Can anyone tell me if ofxFileLoader.loadFromUrl is ok to use in a thread, or is there some way to background http requests so that my animation does not drop frames when the http requests happen?
This is the call stack:
Here is the thread code:
#pragma once
#include "ofMain.h"
#include "ofxRuiThread.h"
class HttpThread:public ofxRuiThread {
public:
ofxFileLoader imageLoader;
string cameraUrl, imgPath;
bool loading;
HttpThread(){
loading = false;
cout<<"Thread init\n";
}
void updateThread(){
loading = true;
if(imageLoader.loadFromUrl(cameraUrl,imgPath)) {
cout<<"HTTP thread: Saved image to: "<<imgPath<<"\n";
}
loading = false;
}
};
Rob