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

Memory leak in move assignment? #11

Open
jreniecki opened this issue Sep 9, 2023 · 0 comments
Open

Memory leak in move assignment? #11

jreniecki opened this issue Sep 9, 2023 · 0 comments

Comments

@jreniecki
Copy link

jreniecki commented Sep 9, 2023

Why does the move assignment do not release the memory poitned by ptr_ ?
https://github.com/PacktPublishing/Cpp-High-Performance-Second-Edition/blob/master/Chapter02/move_semantics.cpp#L50C3-L57C4
The object has been constructed, so ptr_ points to some memory. It seems that there should be delete[] ptr_ just like in the copy assignment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant