Does this cause a memory leak because pWinsock didn't get deleted inside the fonction?
Winsock* CreateWinsock()
{
Winsock* pWinsock=new Winsock;
return pWinsock;
}
Edit: Actually, I cannot delete my pointer since it is a member of Game (pWinsock) that received the newly created Winsock in the code above. Is there anything wrong with this?
class Game{
public:
Game();
~Game();
void CreateWindowClass(HINSTANCE);
void CreateRessources(HINSTANCE);
void ShowLoginScreen();
HWND Getm_hWnd();
public:
D2DResources* pD2DResources;
Winsock* pWinsock;
MessageLog* pMessageLog;
private:
HWND m_hWnd;
};