-
Notifications
You must be signed in to change notification settings - Fork 0
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 #1
Comments
Good point, thank you. I'll fix it and update the post (though I won't have a chance for a few days).
…-------- Original Message --------
On May 12, 2024, 4:26 PM, Gerrit Birkeland wrote:
https://github.com/pboyd/cheeseshop/blob/e2f38decf48875f8bdef7555d63c66931902bcde/cheeseshop.cpp#L34-L38
This code has a memory leak if I have a CheeseShop which already has a clerkName pointer
It'd be better to use a std::unique_ptr here, though I get why you didn't given the subject of your post... raw pointers are almost always a bad idea.
—
Reply to this email directly, [view it on GitHub](#1), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AABHQQIVANMLTMZJ5USG3TLZB7F7XAVCNFSM6AAAAABHTCQ7ECVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TCNBYHA3TCNQ).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
This has been fixed. Thanks again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cheeseshop/cheeseshop.cpp
Lines 34 to 38 in e2f38de
This code has a memory leak if I have a
CheeseShop
which already has aclerkName
pointerIt'd be better to use a
std::unique_ptr
here, though I get why you didn't given the subject of your post... raw pointers are almost always a bad idea.The text was updated successfully, but these errors were encountered: