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

Fix #7088: close AI/GS textfile window when their data are invalid #7094

Merged
merged 1 commit into from Feb 6, 2020

Conversation

SamuXarick
Copy link
Contributor

… displaying a textfile

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this solution, it's too brittle. The issue boils down to the Window trying to maintain something consistent when the underlying state (the slot) changes.

Instead, the window should "save" the ScriptConfig object (GetConfig(slot)) in its constructor, and just refer to that from then on. Should help to fix a couple of the other recent issues (#7090, #7091) as well, I think...

@SamuXarick
Copy link
Contributor Author

I added a solution based on OnInvalidateData, to complement the first. The only place I can think of that could alter the content of this window is via WC_AI_LIST (the window that lets me chose from a list of available AIs/GSs). So that's where it's called from at the moment.

@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from cbef522 to 7cd6d41 Compare January 30, 2019 03:18
@SamuXarick SamuXarick changed the title Fix #7088: Retrieve an appropriate name for a non-existant AI/GS when… Fix #7088: Retrieve an appropriate name for a non-existant AI/GS when displaying a textfile Jan 30, 2019
@stale
Copy link

stale bot commented Mar 1, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale Stale issues label Mar 1, 2019
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 7cd6d41 to 267a6ff Compare March 1, 2019 15:05
@stale stale bot removed the stale Stale issues label Mar 1, 2019
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 267a6ff to 7a2c654 Compare March 31, 2019 15:18
@SamuXarick
Copy link
Contributor Author

SamuXarick commented Mar 31, 2019

For some reason, this fix stopped working properly. :(

EDIT: fixed it.

src/ai/ai_gui.cpp Outdated Show resolved Hide resolved
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 7a2c654 to 3202db5 Compare March 31, 2019 16:22
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch 3 times, most recently from 4477d17 to 08ecbf1 Compare April 13, 2019 18:49
@stale
Copy link

stale bot commented May 13, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale Stale issues label May 13, 2019
@andythenorth
Copy link
Contributor

Stale. Closing, thanks.

@SamuXarick
Copy link
Contributor Author

ping for review

@LordAro LordAro reopened this Nov 15, 2019
@LordAro LordAro removed the stale Stale issues label Nov 15, 2019
src/ai/ai_gui.cpp Outdated Show resolved Hide resolved
@SamuXarick SamuXarick changed the title Fix #7088: Retrieve an appropriate name for a non-existant AI/GS when displaying a textfile Fix #7088: close AI/GS textfile window when their data are invalid Dec 27, 2019
@nielsmh nielsmh dismissed LordAro’s stale review February 6, 2020 19:06

No more memory leak

src/ai/ai_gui.cpp Outdated Show resolved Hide resolved
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 3761d8f to 503c63c Compare February 6, 2020 19:57
@LordAro LordAro merged commit 3089c62 into OpenTTD:master Feb 6, 2020
@LordAro LordAro changed the title Fix #7088: close AI/GS textfile window when their data are invalid Fix #7088: close AI/GS textfile window when their data are invalid Feb 6, 2020
@SamuXarick SamuXarick deleted the ai-gs-name-for-textfile-window branch February 23, 2020 09:49
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.

None yet

5 participants