Hello,

I have a class CTest which has many instances of some class called CNetworkManager.
e.g., many functions in CTest create CNetworkManager objects. e.g.,
Qt Code:
  1. void CTest:f1()
  2. {
  3. CNetworkManager *p = new CNetworkManager();
  4. //...do some stuff
  5. // e.g., makePostRequest
  6.  
  7. }
  8. void CTest:f2()
  9. {
  10. CNetworkManager *p = new CNetworkManager();
  11. //...do some other stuff
  12. //e.g., makePostRequest
  13.  
  14. }
To copy to clipboard, switch view to plain text mode 
CNetworkManager is used for network communication. Inside it uses a QNetworkAccessManager
object for that. I usually process a server response in the requestFinished of the CNetworkManager
class and call a CTest method (as callback -- and also pass the data from the server).

You can see I may have many instances of CNetworkManager in my app. My question is where
is it safe to delete these CNetworkManager objects ???? and how?

Thank you.