summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers/XMLConsoleController.cpp')
-rw-r--r--Swift/Controllers/XMLConsoleController.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/Swift/Controllers/XMLConsoleController.cpp b/Swift/Controllers/XMLConsoleController.cpp
index ebc9912..4629573 100644
--- a/Swift/Controllers/XMLConsoleController.cpp
+++ b/Swift/Controllers/XMLConsoleController.cpp
@@ -1,25 +1,26 @@
#include "Swift/Controllers/XMLConsoleController.h"
#include "Swift/Controllers/UIInterfaces/XMLConsoleWidgetFactory.h"
-
#include "Swift/Controllers/UIEvents/RequestXMLConsoleUIEvent.h"
namespace Swift {
-XMLConsoleController::XMLConsoleController(UIEventStream* uiEventStream, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory) {
- uiEventStream_ = uiEventStream;
- xmlConsoleWidgetFactory_ = xmlConsoleWidgetFactory;
- uiEventStream_->onUIEvent.connect(boost::bind(&XMLConsoleController::handleUIEvent, this, _1));
- xmlConsoleWidget_ = NULL;
+
+XMLConsoleController::XMLConsoleController(UIEventStream* uiEventStream, XMLConsoleWidgetFactory* xmlConsoleWidgetFactory) : xmlConsoleWidgetFactory(xmlConsoleWidgetFactory), xmlConsoleWidget(NULL) {
+ uiEventStream->onUIEvent.connect(boost::bind(&XMLConsoleController::handleUIEvent, this, _1));
+}
+
+XMLConsoleController::~XMLConsoleController() {
+ delete xmlConsoleWidget;
}
void XMLConsoleController::handleUIEvent(boost::shared_ptr<UIEvent> rawEvent) {
boost::shared_ptr<RequestXMLConsoleUIEvent> event = boost::dynamic_pointer_cast<RequestXMLConsoleUIEvent>(rawEvent);
if (event != NULL) {
- if (xmlConsoleWidget_ == NULL) {
- xmlConsoleWidget_ = xmlConsoleWidgetFactory_->createXMLConsoleWidget();
+ if (xmlConsoleWidget == NULL) {
+ xmlConsoleWidget = xmlConsoleWidgetFactory->createXMLConsoleWidget();
}
- xmlConsoleWidget_->show();
- xmlConsoleWidget_->activate();
+ xmlConsoleWidget->show();
+ xmlConsoleWidget->activate();
}
}