changeset 24:cb87d40e9342

fix exceptions and cleanup code
author spq@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 11 Jul 2008 11:00:10 +0000
parents e5e2fec68834
children fc6713d72b80
files engine/core/view/renderers/genericrenderer.cpp
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/engine/core/view/renderers/genericrenderer.cpp	Fri Jul 11 10:42:31 2008 +0000
+++ b/engine/core/view/renderers/genericrenderer.cpp	Fri Jul 11 11:00:10 2008 +0000
@@ -89,32 +89,32 @@
 
 	Instance* GenericRendererNode::getAttachedInstance() {
 		if(m_instance == NULL) {
-			throw "asd";
+			throw NotSupported("No instance attached.");
 		}
 		return m_instance;
 	}
 	Location* GenericRendererNode::getAttachedLocation() {
 		if(m_instance != NULL or m_location == NULL) {
-			throw "asd";
+			throw NotSupported("No location attached.");
 		}
 		return m_location;
 	}
 	Point GenericRendererNode::getAttachedPoint() {
 		if(m_instance != NULL or m_location != NULL) {
-			throw "asd";
+			throw NotSupported("No point attached.");
 		}
 		return m_point;
 	}
 
 	Location* GenericRendererNode::getOffsetLocation() {
-		if(m_instance == NULL) {
-			throw "asd";
+		if(m_instance == NULL or m_location == NULL) {
+			throw NotSupported("No location as offset used.");
 		}
 		return m_location;
 	}
 	Point GenericRendererNode::getOffsetPoint() {
 		if(m_instance == NULL and m_location == NULL) {
-			throw "asd";
+			throw NotSupported("No point as offset used.");
 		}
 		return m_point;
 	}
@@ -265,6 +265,10 @@
 		m_infos.push_back(info);
 	}
 	void GenericRenderer::removeAll() {
+		std::vector<GenericRendererElementInfo*>::const_iterator info_it = m_infos.begin();
+		for (;info_it != m_infos.end(); ++info_it) {
+			delete *info_it;
+		}
 		m_infos.clear();
 	}