It's true (although it's possible that QHttp closes it itself), but here you create a new file object instead of closing the one already open. You should get a pointer to a QIODevice you assigned when making the request and call close on it.
It shouldn't unless you start deleting the signalling object from a slot again.I moved the code I had before into a done slot and now I do not see that debug error any more. i will have to keep an eye on it to ensure that it does not return.
Every id is unique per object, so the pair (QHttp*, id) can't duplicate.I can not simply look up the request id in my table to ensure I am working on the correct entry since there could be duplicates, right?):
BTW. If you make a qobject_cast, you should check if it doesn't return 0. If you're sure that it is a QHttp* (like in this case), you can make a static_cast instead.
I think you can (but don't have to - your code should be slightly faster) substitute it with:Qt Code:
int index = httpPointers.indexOf(sendHttp); httpPointers.removeAt(index);To copy to clipboard, switch view to plain text mode
Qt Code:
httpPointers.removeAll(sendHttp);To copy to clipboard, switch view to plain text mode






Reply With Quote
Bookmarks