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

CD3DVertexShader::Release: Use SAFE_DELETE_ARRAY with m_vertexLayout #9875

Conversation

dennisebben
Copy link

@dennisebben dennisebben commented May 24, 2016

m_vertexLayout is an array. It's created like:
m_vertexLayout = new D3D11_INPUT_ELEMENT_DESC[vertexLayoutSize];

This array was deleted with SAFE_DELETE.
#define SAFE_DELETE(p) { delete (p); p = nullptr; }

Arrays should be deleted with SAFE_DELETE_ARRAY:
#define SAFE_DELETE_ARRAY(p) { delete [](p); p = nullptr; }

(sorry, branch name is a little bit confusing, since it's not about allocating but freeing)

@afedchin
Copy link
Member

Thanks. +1

@dennisebben
Copy link
Author

dennisebben commented May 24, 2016

YW.

Failing build seems unrelated.

@stefansaraev
Copy link
Contributor

jenkins build this please

@MartijnKaijser MartijnKaijser merged commit 1647d30 into xbmc:master Jun 4, 2016
@MartijnKaijser MartijnKaijser added this to the Krypton 17.0-alpha2 milestone Jun 4, 2016
@dennisebben dennisebben deleted the fixInvalidHeapAllocationCD3DVertexShader branch June 4, 2016 20:15
@dennisebben dennisebben restored the fixInvalidHeapAllocationCD3DVertexShader branch June 4, 2016 20:24
@dennisebben dennisebben deleted the fixInvalidHeapAllocationCD3DVertexShader branch June 4, 2016 20:25
@dennisebben dennisebben restored the fixInvalidHeapAllocationCD3DVertexShader branch June 6, 2016 06:28
@dennisebben dennisebben deleted the fixInvalidHeapAllocationCD3DVertexShader branch June 6, 2016 06:33
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

Successfully merging this pull request may close these issues.

4 participants