Move message subscription to the end of window post-initialisation.
If a message arrives before post-initialisation has completed, access
to uninitialised variables can occur, causing a segfault.
Make message subscription the very last action.
---
trunk/src/client/gui/pawsskillwindow.cpp | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/trunk/src/client/gui/pawsskillwindow.cpp b/trunk/src/client/gui/pawsskillwindow.cpp
index 6f0f089..e47bdaf 100644
--- a/trunk/src/client/gui/pawsskillwindow.cpp
+++ b/trunk/src/client/gui/pawsskillwindow.cpp
@@ -93,8 +93,6 @@ bool pawsSkillWindow::PostSetup()
{
return false;
}
- psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_GUISKILL);
- psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_FACTION_INFO);
xml = csQueryRegistry<iDocumentSystem > ( PawsManager::GetSingleton().GetObjectRegistry());
@@ -143,6 +141,9 @@ bool pawsSkillWindow::PostSetup()
currentTab =0;
previousTab =0;
+ psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_GUISKILL);
+ psengine->GetMsgHandler()->Subscribe(this, MSGTYPE_FACTION_INFO);
+
return true;
}