The MSDN documentation for CInternetSession::Close()only
Call this member function when your application has finished using the object CInternetSession.
MSDN for CInternetSession :: Close
For the object CHttpConnectionbeing returned CInternetSession::GetHttpConnection()and the object CHttpFilebeing returned CHttpConnection::OpenRequest(), should they be manually closed and deleted?
I cannot find the documentation for CHttpConnection::Close()on MSDN, but CHttpFileinherits my method Close()from CInternetFile; documentation for which is also useless:
Closes a CInternetFileand frees any of its resources.
(sorry, I cannot have three links)
My guess would be that with CInternetSession::GetHttpConnection()and CHttpConnection::OpenRequest()return pointers, and since MSDN for CHttpConnectionsays
CHttpConnection ; , CInternetSession::GetHttpConnection, CHttpConnection .
(, )
CInternetSession CHttpConnection, , CInternetSession::Close(). MSDN, -
CInternetSession → .
:
CInternetSession session(...);
CHttpConnection * connection = session.GetHttpConnection(...);
CHttpFile * file = connection->OpenRequest(...);
... Do stuff ...
file->Close();
delete file;
connection->Close();
delete connection;
session.Close();
:
CInternetSession session(...);
CHttpConnection * connection = session.GetHttpConnection(...);
CHttpFile * file = connection->OpenRequest(...);
... Do stuff ...
session.Close();
-
--- --- , , ? , Valgrind , , ?