Originally Posted by
wysota
You can delete them once you're done using them either by an explicit delete call or with deleteLater().
Hi, thanks for your response.
In the requestFinished of the CNetworkManager class I invoke a callback from my CTest as I mentioned, e.g., like this:
void CNetworkManager::requestFinished(QNetworkReply* reply)
{
//...
this->ptCallBackCTest(ptObject, netResponse);
// (*) we will get here - to line number 5 - after the callback finished execution right? So, if I delete here the CNetworkManager instance or "this" in other
// words it means I am "killing myself" within my own function.
//..
}
void CNetworkManager::requestFinished(QNetworkReply* reply)
{
//...
this->ptCallBackCTest(ptObject, netResponse);
// (*) we will get here - to line number 5 - after the callback finished execution right? So, if I delete here the CNetworkManager instance or "this" in other
// words it means I am "killing myself" within my own function.
//..
}
To copy to clipboard, switch view to plain text mode
In other way, I could also pass a pointer to "this" (above code) to the callback function and try to delete it inside the CTest callback -- but in that
case I will never reach the 5th line as above -- and will not it cause crash??? Thanks.
Bookmarks