Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible Memory Leak in OPUNetDlgWindow #117

Open
Brett208 opened this issue Mar 30, 2020 · 0 comments
Open

Possible Memory Leak in OPUNetDlgWindow #117

Brett208 opened this issue Mar 30, 2020 · 0 comments

Comments

@Brett208
Copy link
Member

Within the function InitializeNetTransportLayer, app.netTLayer is set to the value of a raw pointer. InitializeNetTransportLayer is called from 2 different parts of OPUNetDlgWindow.

I think we may need to call delete on app.netTLayer before setting it to the new pointer.

void OPUNetGameSelectWnd::InitializeNetTransportLayer()
{
	opuNetTransportLayer = OPUNetTransportLayer::Create();

	if (opuNetTransportLayer == nullptr)
	{
		// Error creating the transport layer
		EndDialog(this->hWnd, true);		// bCancel = true
		return;
	}

	// Set the global NetTransportLayer object pointer
	app.netTLayer = opuNetTransportLayer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant