How to track if ofImages are being loaded/loaded already using ofxThreadedImageLoader?


How do I check if ofxThreadedImageLoader instance is currently loading some images or if it has finished loading?
From what I understand, it is a child of the ofThread parent class.

I already looked into this addon’s files and in header, it has some struct called ofImageLoaderEntry, containing pointer to an ofImage ofImage* image , but it is private, and I cannot access it from an instance of this class. This way I could have maybe checked if the ofImage pointed at by pointer is allocated or something… but I don’t know… Do I really have to modify the addon to do so and make the struct public?

Or, can I use the bool isThreadRunning() that is inherited from the ofThread parent to do so (check the process if the threaded loader is currently loading something, so to speak…)? But, I’m not sure if the thread is “running” only while active doing stuff like loading images etc. , or is it active all the time until the app/class stops the thread by using stopThread(); … ?

The problem is - imagine you have some vector of images, or perhaps a multidimensional array of ofImages. Now, you can indeed check if an ofImage is allocated or not. You want to load the buffer(vector/aray) of images over their previous content, but that means they’re still allocated. But how to check whether an ofxThreadedImageLoader object is currently loading something or not?
(I imagine some rag-tag solution of deleting/disallocating the images prior to load new images with ofxThreadedImageLoader, but I don’t know if this is a good approach :confused: )

(EDIT: I considered this a problem for beginners; it shouldn’t be)