-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
Hi,
I noticed a runtime exception that raised in ofURLFileLoaderImpl::update(), after I finished 2 correct downloading processes and deleted the 2 ofURLFileLoader instances in my object.
It seems that the framework was trying to callback the handler(ofURLFileLoaderImpl::update) which has already gone.
So I checked the source code of ofURLFileLoader.cpp, and noticed there is:
void ofURLFileLoaderImpl::start() {
if (!isThreadRunning()) {
ofAddListener(ofEvents().update, this, &ofURLFileLoaderImpl::update);
startThread();
}
}
But there isn't corresponding ofRemoveListener() anywhere.
And it seems to be a bug? So I've tried using ofURLFileLoader as singleton(as static member), and no error occurs, and it can also explain the above source code, the callback does always exist.
Sorry for no call stack info and I have no proper environment for testing the above guess, but if the info helps, it might be fixed after the ofThread ends?
Thanks a lot!