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

@SamuXarick SamuXarick commented Jan 24, 2019

… displaying a textfile

LordAro
LordAro previously requested changes Jan 24, 2019
Copy link
Member

@LordAro LordAro left a comment

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

@SamuXarick SamuXarick commented Jan 25, 2019

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 Jan 30, 2019
@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 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 label Mar 1, 2019
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 7cd6d41 to 267a6ff Compare Mar 1, 2019
@stale stale bot removed the stale label Mar 1, 2019
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 267a6ff to 7a2c654 Compare Mar 31, 2019
@SamuXarick
Copy link
Contributor Author

@SamuXarick 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 Mar 31, 2019
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch 3 times, most recently from 4477d17 to 08ecbf1 Compare Apr 13, 2019
@stale
Copy link

@stale 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 label May 13, 2019
@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Jun 29, 2019

Stale. Closing, thanks.

@SamuXarick
Copy link
Contributor Author

@SamuXarick SamuXarick commented Jul 19, 2019

ping for review

@LordAro LordAro reopened this Nov 15, 2019
@LordAro LordAro dismissed their stale review Nov 15, 2019

outdated

@LordAro LordAro removed the stale label Nov 15, 2019
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 08ecbf1 to 3398ff6 Compare Nov 15, 2019
LordAro
LordAro previously requested changes Dec 27, 2019
src/ai/ai_gui.cpp Outdated Show resolved Hide resolved
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 3398ff6 to 1426f45 Compare Dec 27, 2019
@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
@SamuXarick SamuXarick force-pushed the ai-gs-name-for-textfile-window branch from 1426f45 to 3761d8f Compare Dec 31, 2019
@nielsmh nielsmh dismissed LordAro’s stale review Feb 6, 2020

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 Feb 6, 2020
nielsmh
nielsmh approved these changes Feb 6, 2020
LordAro
LordAro approved these changes Feb 6, 2020
@LordAro LordAro merged commit 3089c62 into OpenTTD:master Feb 6, 2020
8 checks passed
@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 Feb 23, 2020
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