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

Use of non-array delete #16

Closed
wants to merge 3 commits into from

Conversation

ennorehling
Copy link
Contributor

While most implementations do the right thing for delete on scalars, it's still a bug not to use delete[]. Especially on an array of objects (destructors need to be called), as in the case of GetNewUnit (game.cpp).

valdisz pushed a commit to valdisz/Atlantis that referenced this pull request Oct 27, 2019
@valdisz
Copy link
Contributor

valdisz commented Nov 30, 2021

@artyomtrityak we could incorporate this PR into neworigins branch, it removes some warnings that are obviously bugs in AString

jt-traub added a commit that referenced this pull request May 8, 2024
* Pulls changes for PR #16
* While these didn't cause any errors/warnings during compile they are
  technically more correct code.
@jt-traub
Copy link
Contributor

jt-traub commented May 8, 2024

While a number of these had previously been cleaned up a couple weren't. The compiler wasn't warning on them, mostly because compilers have gotten better, but the code correctness is technically better. Closing this as it's been pulled into PR #189

@jt-traub jt-traub closed this May 8, 2024
jt-traub added a commit that referenced this pull request May 8, 2024
Too few trade goods causes infinite loop
* Pull in the work from PR No trade items bugfix #54
* Avoid an infinite loop when we have less than 4 trade items.

Clean up food item cost display in rules
* Pull in work from PR Rules say no fractional food #120
* Remove an extraneous comma
* Add text saying partial food is lost.
* Update rules snapshots with changes.

Update rules to explain order of maintenance costs
* Pulled in changes from PR Added clarification on how maintenance fee is paid #111
* Added section to rules showing order of maintenance payments.
* Updated snapshots to reflect changes.

Fix longstanding economy bug
* Pulled in changes from PR Update economy.cpp #8
* Economic improvement never counted users selling trade goods to a city/town

Fix logical bug in world generation code
* Pulls in changes from PR Fix using assignation instead of compare #53
* All games except neworigins and standard had this bug - it had been previously fixed (partially) in those 2 codebases, but added parens to make sure comparison was correct.

Small code quality cleanups on delete[] vs delete
* Pulls changes for PR Use of non-array delete #16
* While these didn't cause any errors/warnings during compile they are technically more correct code.

Updated CREDITS file with some names that I was able to find that weren't already recorded.
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.

3 participants