From 0b4d42cce98c712d7117a4bfa5606464bb7103f2 Mon Sep 17 00:00:00 2001
From: Kevin Smith <git@kismith.co.uk>
Date: Sat, 26 Jun 2010 21:05:25 +0100
Subject: Fix segfault on second sign-in


diff --git a/Swift/Controllers/MainController.cpp b/Swift/Controllers/MainController.cpp
index a2fb3a4..1265979 100644
--- a/Swift/Controllers/MainController.cpp
+++ b/Swift/Controllers/MainController.cpp
@@ -95,7 +95,6 @@ MainController::MainController(ChatWindowFactory* chatWindowFactory, MainWindowF
 	systemTrayController_ = new SystemTrayController(eventController_, systemTray);
 	loginWindow_ = loginWindowFactory_->createLoginWindow(uiEventStream_);
 	soundEventController_ = new SoundEventController(eventController_, soundPlayer, settings, uiEventStream_);
-	statusTracker_  = new StatusTracker();
 
 	String selectedLoginJID = settings_->getStringSetting("lastLoginJID");
 	bool loginAutomatically = settings_->getBoolSetting("loginAutomatically", false);
@@ -229,6 +228,7 @@ void MainController::handleConnected() {
 		serverDiscoInfo_ = boost::shared_ptr<DiscoInfo>(new DiscoInfo());
 
 		mucSearchController_ = new MUCSearchController(jid_, uiEventStream_, mucSearchWindowFactory_, client_);
+		statusTracker_  = new StatusTracker();
 	}
 	
 	boost::shared_ptr<GetDiscoInfoRequest> discoInfoRequest(new GetDiscoInfoRequest(JID(), client_));
-- 
cgit v0.10.2-6-g49f6