# HG changeset patch # User frosch # Date 2011-03-13 21:34:49 # Node ID fc8b6fa189032459b15394f85ad8db51f7e943e4 # Parent 4dbb8b190ff9680325cd6c91a067f7dc9c5d00a4 (svn r22248) -Codechange: Make OnInvalidateData() process 'delete this;' already in command scope. diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -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; } }; diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -652,7 +652,6 @@ public: */ virtual void OnInvalidateData(int data = 0, bool gui_scope = true) { - if (!gui_scope) return; /* If company gets shut down, while displaying an error about it, remove the error message. */ if (this->face != INVALID_COMPANY && !Company::IsValidID(this->face)) delete this; } diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -538,7 +538,6 @@ struct NetworkChatWindow : public QueryS */ virtual void OnInvalidateData(int data = 0, bool gui_scope = true) { - if (!gui_scope) return; if (data == this->dest) delete this; } };