From 8d6d486420fa2ed97979d3855e3051ef022cccb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Sat, 24 Apr 2010 21:23:08 +0200
Subject: Avoid segfault on Slimber shutdown.


diff --git a/Slimber/MainController.cpp b/Slimber/MainController.cpp
index e5def24..3699498 100644
--- a/Slimber/MainController.cpp
+++ b/Slimber/MainController.cpp
@@ -23,10 +23,6 @@
 using namespace Swift;
 
 MainController::MainController(Menulet* menulet) : menulet(menulet) {
-	menuletController = new MenuletController(menulet);
-	menuletController->onRestartRequested.connect(boost::bind(
-			&MainController::handleRestartRequested, this));
-
 	dnsSDQuerier = PlatformDNSSDQuerierFactory().createQuerier();
 	assert(dnsSDQuerier);
 
@@ -47,12 +43,17 @@ MainController::MainController(Menulet* menulet) : menulet(menulet) {
 	server->onSelfConnected.connect(
 			boost::bind(&MainController::handleSelfConnected, this, _1));
 
+	menuletController = new MenuletController(menulet);
+	menuletController->onRestartRequested.connect(boost::bind(
+			&MainController::handleRestartRequested, this));
+
+
 	start();
 }
 
 MainController::~MainController() {
-	delete menuletController;
 	delete server;
+	delete menuletController;
 	delete vCardCollection;
 	linkLocalServiceBrowser->stop();
 	delete linkLocalServiceBrowser;
diff --git a/Slimber/Qt/.gitignore b/Slimber/Qt/.gitignore
new file mode 100644
index 0000000..83750b9
--- /dev/null
+++ b/Slimber/Qt/.gitignore
@@ -0,0 +1 @@
+BuildVersion.h
-- 
cgit v0.10.2-6-g49f6