(svn r22248) -Codechange: Make OnInvalidateData() process 'delete this;' already in command scope.
This commit is contained in:
@@ -189,12 +189,13 @@ struct AIListWindow : public Window {
|
||||
*/
|
||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) {
|
||||
delete this;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gui_scope) return;
|
||||
|
||||
this->vscroll->SetCount((int)this->ai_info_list->size() + 1);
|
||||
|
||||
/* selected goes from -1 .. length of ai list - 1. */
|
||||
@@ -450,7 +451,6 @@ struct AISettingsWindow : public Window {
|
||||
*/
|
||||
virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
|
||||
{
|
||||
if (!gui_scope) return;
|
||||
if (_game_mode == GM_NORMAL && Company::IsValidID(this->slot)) delete this;
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user