Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreSharedRuns.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreSharedRuns.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreSharedRuns.h	(revision 2320)
@@ -189,5 +189,18 @@
 	void runChanged(RenderingRunType runType, RenderingRun* run);
 	//inherited
-	virtual void addTechniqueGroup(TechniqueGroup* group){childTechniqueGroups.push_back(group);}
+	void addTechniqueGroup(TechniqueGroup* group){childTechniqueGroups.push_back(group);}
+	void removeTechniqueGroups()
+	{
+		std::vector<TechniqueGroup*>::iterator it = childTechniqueGroups.begin();
+		std::vector<TechniqueGroup*>::iterator itend = childTechniqueGroups.end();
+		while(it != itend)
+		{
+			TechniqueGroup* tg = (*it);
+			childTechniqueGroups.erase(it);
+			delete tg;
+			it++;
+		}
+		childTechniqueGroups.clear();
+	}
 	/**
 	 @brief Sets the given material for all connected renderables.
@@ -202,4 +215,6 @@
 	*/
 	void restoreMaterial();
+
+	void freeAllResources();
 
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 2298)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreIlluminationManager.h	(revision 2320)
@@ -549,4 +549,6 @@
 	*/
 	void setFireRenderTargetSize(int size){FireRenderTarget::targetsize = size;}
+
+	void freeAllResources();
 };
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderingRun.h	(revision 2320)
@@ -25,4 +25,6 @@
 		fullscreenGrid = 0;
 	}
+	
+	virtual ~OgreRenderingRun(){}
 	/**
 		@brief Conversion to OgreRenderRun.
@@ -32,5 +34,4 @@
 	OgreRenderingRun* asOgreRenderingRun(){return this;}
 
-	
 protected:
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreTechniqueGroup.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreTechniqueGroup.h	(revision 790)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreTechniqueGroup.h	(revision 2320)
@@ -14,4 +14,5 @@
 {
 public:
+	~OgreTechniqueGroup();
 	//inherited
 	void addRenderTechnique(RenderTechnique* technique);
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreFocusingMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreFocusingMapRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreFocusingMapRenderingRun.h	(revision 2320)
@@ -30,4 +30,6 @@
 								Matrix4 lightMatrix,
 								unsigned int focusingMapSize);
+
+	virtual ~OgreFocusingMapRenderingRun(){}
 	/**
 		@brief returns the name of the focusing texture
@@ -48,4 +50,6 @@
 	*/
 	void setCameraMatrices(const Matrix4 &view, const Matrix4 &projection);
+
+	void freeAllResources();
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreSceneCameraDepthRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreSceneCameraDepthRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreSceneCameraDepthRenderingRun.h	(revision 2320)
@@ -31,4 +31,7 @@
 								String name,
 								Viewport* playerView);
+
+	virtual ~OgreSceneCameraDepthRenderingRun(){}
+
 	/**
 		@brief returns the name of the camera depth texture
@@ -36,4 +39,5 @@
 	String getDepthTextureName(){return name;}
 
+	void freeAllResources();
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCubeMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCubeMapRenderingRun.h	(revision 2251)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCubeMapRenderingRun.h	(revision 2320)
@@ -56,4 +56,7 @@
 								 bool getMinMax,
 								 RenderingRunType cubemapRunType);
+
+	virtual ~OgreCubeMapRenderingRun(){}
+
 	/**
 		@brief returns the name of the resulting color cubemap texture
@@ -63,4 +66,6 @@
 	Vector4 getMax(){return max;}
 	Vector4 getMin(){return min;}
+
+	void freeAllResources();
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreLightVolumeRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreLightVolumeRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreLightVolumeRenderingRun.h	(revision 2320)
@@ -38,4 +38,7 @@
 								unsigned int textureDepth,
 								String materialName);
+
+	virtual ~OgreLightVolumeRenderingRun(){}
+
 	/**
 		@brief returns the name of the resulting light volume texture
@@ -68,4 +71,6 @@
 	}
 	
+	void freeAllResources();
+
 protected:	
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePMWeightComputeRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePMWeightComputeRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePMWeightComputeRenderingRun.h	(revision 2320)
@@ -29,4 +29,7 @@
 	*/	
 	OgrePMWeightComputeRenderingRun(String name, String LightName);
+
+	virtual ~OgrePMWeightComputeRenderingRun(){}
+
 	/**
 		@brief returns the name of the weight texture
@@ -35,4 +38,6 @@
 	//not used
 	float* getWeights(){return weights;}
+
+	void freeAllResources();
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhaseTextureRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhaseTextureRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhaseTextureRenderingRun.h	(revision 2320)
@@ -34,8 +34,12 @@
 										String materialName);
 
+	virtual ~OgrePhaseTextureRenderingRun(){}
+
 	/**
 		@brief returns the name of thew phase texture created by this run
 	*/
 	String getPhaseTextureName(){return name;}
+
+	void freeAllResources();
 	
 protected:	
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhotonMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhotonMapRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePhotonMapRenderingRun.h	(revision 2320)
@@ -39,4 +39,7 @@
 								String materialName,
 								bool useDistance);
+
+	virtual ~OgrePhotonMapRenderingRun(){}
+
 	/**
 		@brief returns the name of the resulting photon hit map texture
@@ -59,4 +62,6 @@
 	//inherited	
 	void distanceCubeMapUpdated(RenderingRun* run);
+
+	void freeAllResources();
 	
 protected:	
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePMEntryPointMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePMEntryPointMapRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgrePMEntryPointMapRenderingRun.h	(revision 2320)
@@ -28,4 +28,7 @@
 	*/	
 	OgrePMEntryPointMapRenderingRun(String name);
+
+	virtual ~OgrePMEntryPointMapRenderingRun(){}
+
 	/**
 		@brief returns the name of the entry point texture
@@ -38,4 +41,6 @@
 	*/
 	String getClusterLengthTextureName(){return clusterLengthTexture->getName();}
+
+	void freeAllResources();
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCausticCubeMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCausticCubeMapRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreCausticCubeMapRenderingRun.h	(revision 2320)
@@ -48,4 +48,6 @@
 								 bool blurMap
 								 );
+
+	virtual ~OgreCausticCubeMapRenderingRun(){}
 	/**
 		@brief returns the name of the resulting caustic cubemap texture
@@ -77,4 +79,6 @@
 	*/
 	void setBlurMap(bool blur){blurMap = blur;}
+
+	void freeAllResources();
 
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreChildPSystemRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreChildPSystemRenderingRun.h	(revision 2251)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreChildPSystemRenderingRun.h	(revision 2320)
@@ -46,4 +46,7 @@
 								String materialName
 								);
+
+	virtual ~OgreChildPSystemRenderingRun(){}
+
 	/**
 		@brief returns the name of the resulting photon hit map
@@ -61,4 +64,6 @@
 	*/
 	Real getSmallSysRadius(){return sysRad;}
+
+	void freeAllResources();
 
 protected:	
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreDepthShadowMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreDepthShadowMapRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreDepthShadowMapRenderingRun.h	(revision 2320)
@@ -39,4 +39,7 @@
 										String materialName);
 
+	virtual ~OgreDepthShadowMapRenderingRun(){}
+
+
 	/**
 		@brief returns the depth shadow map texture created by this run
@@ -60,4 +63,6 @@
 	*/
 	Real getLightFarPlane(){return lightFarPlane;}
+
+	void freeAllResources();
 
 protected:	
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreReducedCubeMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreReducedCubeMapRenderingRun.h	(revision 2264)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderingRuns/OgreReducedCubeMapRenderingRun.h	(revision 2320)
@@ -46,4 +46,6 @@
 								 bool updateAllFace = false);
 
+	virtual ~OgreReducedCubeMapRenderingRun(){}
+
 	/**
 		@brief returns the name of the resulting downsampled color cubemap texture
@@ -53,4 +55,6 @@
 	//inherited
 	void colorCubeMapChanged(String& newMapName);
+
+	void freeAllResources();
 
 protected:	
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/OgreRenderTechnique.h	(revision 2320)
@@ -42,5 +42,5 @@
 						OgreRenderable* parentRenderable,
 						OgreTechniqueGroup* parentTechniqueGroup);
-		~OgreRenderTechnique( );
+		virtual ~OgreRenderTechnique( );
 
 		//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreSBBRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreSBBRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreSBBRenderTechnique.h	(revision 2320)
@@ -38,5 +38,5 @@
 							OgreTechniqueGroup* parentTechniqueGroup
 							);
-	~OgreSBBRenderTechnique();
+	virtual ~OgreSBBRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDistanceCubeMapRenderTechnique.h	(revision 2320)
@@ -72,5 +72,5 @@
 		@brief Destructor.
 	*/
-	~OgreDistanceCubeMapRenderTechnique();
+	virtual ~OgreDistanceCubeMapRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreHierarchicalParticleSystemTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreHierarchicalParticleSystemTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreHierarchicalParticleSystemTechnique.h	(revision 2320)
@@ -58,5 +58,5 @@
 		@brief Destructor.
 	*/
-	~OgreHierarchicalParticleSystemTechnique();
+	virtual ~OgreHierarchicalParticleSystemTechnique();
 
 		
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreIllumVolumeRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreIllumVolumeRenderTechnique.h	(revision 2302)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreIllumVolumeRenderTechnique.h	(revision 2320)
@@ -52,5 +52,5 @@
 		@brief Destructor.
 	*/
-	~OgreIllumVolumeRenderTechnique();
+	virtual ~OgreIllumVolumeRenderTechnique();
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h	(revision 2299)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgrePathMapRenderTechnique.h	(revision 2320)
@@ -41,5 +41,5 @@
 		@brief Destructor.
 	*/
-	~OgrePathMapRenderTechnique();
+	virtual ~OgrePathMapRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreColorCubeMapRenderTechnique.h	(revision 2320)
@@ -72,5 +72,5 @@
 		@brief Destructor.
 	*/
-	~OgreColorCubeMapRenderTechnique();
+	virtual ~OgreColorCubeMapRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreConvolvedCubeMapRenderTechnique.h	(revision 2320)
@@ -72,5 +72,5 @@
 		@brief Destructor.
 	*/
-	~OgreConvolvedCubeMapRenderTechnique();
+	virtual ~OgreConvolvedCubeMapRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCubeMapRenderTechnique.h	(revision 2320)
@@ -73,5 +73,5 @@
 		@brief Destructor.
 	*/
-	~OgreCubeMapRenderTechnique();
+	virtual ~OgreCubeMapRenderTechnique();
 	
 		
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h	(revision 2299)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticCasterRenderTechnique.h	(revision 2320)
@@ -56,5 +56,5 @@
 		@brief Destructor.
 	*/
-	~OgreCausticCasterRenderTechnique();	
+	virtual ~OgreCausticCasterRenderTechnique();	
 	/**
 		@brief Returns the name of the created caustic cubemap.
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.h	(revision 2299)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreDepthShadowReceiverRenderTechnique.h	(revision 2320)
@@ -74,5 +74,5 @@
 		@brief Destructor.
 	*/
-	~OgreDepthShadowReceiverRenderTechnique();
+	virtual ~OgreDepthShadowReceiverRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h	(revision 2299)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreCausticReceiverRenderTechnique.h	(revision 2320)
@@ -57,5 +57,5 @@
 		@brief Destructor.
 	*/
-	~OgreCausticReceiverRenderTechnique();
+	virtual ~OgreCausticReceiverRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreFireRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreFireRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/include/RenderTechniques/OgreFireRenderTechnique.h	(revision 2320)
@@ -21,4 +21,5 @@
 
 	FireRenderTarget();	
+	~FireRenderTarget();	
 };
 
@@ -54,5 +55,5 @@
 							OgreTechniqueGroup* parentTechniqueGroup
 							);
-	~OgreFireRenderTechnique();
+	virtual ~OgreFireRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreTechniqueGroup.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreTechniqueGroup.cpp	(revision 790)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreTechniqueGroup.cpp	(revision 2320)
@@ -1,4 +1,17 @@
 #include "OgreTechniqueGroup.h"
 
+
+OgreTechniqueGroup::~OgreTechniqueGroup()
+{
+	std::vector<OgreRenderTechnique*>::iterator it = renderTechniques.begin();
+	std::vector<OgreRenderTechnique*>::iterator itend = renderTechniques.end();
+	while(it != itend)
+	{
+		OgreRenderTechnique* rt = *it;
+		delete rt;
+		it++;
+	}	
+	renderTechniques.clear();	
+}
 
 void OgreTechniqueGroup::addRenderTechnique(RenderTechnique* technique)
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp	(revision 1987)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreLightVolumeRenderingRun.cpp	(revision 2320)
@@ -255,4 +255,11 @@
 }
 
+void OgreLightVolumeRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	TextureManager::getSingleton().remove(name + "NoBlur");
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
+
 
  
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp	(revision 2249)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMWeightComputeRenderingRun.cpp	(revision 2320)
@@ -170,3 +170,10 @@
 }
 
+void OgrePMWeightComputeRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
 
+	TextureManager::getSingleton().remove(name + "_ALL");
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_ALL" + "_CAMERA");
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhaseTextureRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhaseTextureRenderingRun.cpp	(revision 1425)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhaseTextureRenderingRun.cpp	(revision 2320)
@@ -46,2 +46,8 @@
 	renderFullscreenQuad(materialName, rt);	
 }
+
+void OgrePhaseTextureRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp	(revision 1722)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePhotonMapRenderingRun.cpp	(revision 2320)
@@ -152,3 +152,8 @@
 	fpParams->setNamedConstant("lastCenter",center);
 }
- 
+
+void OgrePhotonMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMEntryPointMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMEntryPointMapRenderingRun.cpp	(revision 2200)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgrePMEntryPointMapRenderingRun.cpp	(revision 2320)
@@ -86,3 +86,10 @@
 }
 
+void OgrePMEntryPointMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	TextureManager::getSingleton().remove(name + "_CL");	
+}
 
+
+
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCausticCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCausticCubeMapRenderingRun.cpp	(revision 1688)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCausticCubeMapRenderingRun.cpp	(revision 2320)
@@ -97,2 +97,10 @@
 	return true;
 }
+
+void OgreCausticCubeMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	TextureManager::getSingleton().remove(name + "_BLURED");
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_BLURED" + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 2297)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreDepthShadowMapRenderingRun.cpp	(revision 2320)
@@ -391,2 +391,8 @@
 }
 
+void OgreDepthShadowMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	TextureManager::getSingleton().remove(blurredname);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreReducedCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreReducedCubeMapRenderingRun.cpp	(revision 2055)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreReducedCubeMapRenderingRun.cpp	(revision 2320)
@@ -105,2 +105,8 @@
 
 }
+
+void OgreReducedCubeMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreFocusingMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreFocusingMapRenderingRun.cpp	(revision 2265)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreFocusingMapRenderingRun.cpp	(revision 2320)
@@ -124,3 +124,8 @@
 }
 
+void OgreFocusingMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp	(revision 2302)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreSceneCameraDepthRenderingRun.cpp	(revision 2320)
@@ -65,2 +65,6 @@
 }
 
+void OgreSceneCameraDepthRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp	(revision 2192)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreChildParticlesystemRenderingRun.cpp	(revision 2320)
@@ -132,2 +132,7 @@
 }
 
+void OgreChildPSystemRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCubeMapRenderingRun.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCubeMapRenderingRun.cpp	(revision 2265)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderingRuns/OgreCubeMapRenderingRun.cpp	(revision 2320)
@@ -243,2 +243,8 @@
 	return true;
 }
+
+void OgreCubeMapRenderingRun::freeAllResources()
+{
+	TextureManager::getSingleton().remove(name);
+	Root::getSingleton()._getCurrentSceneManager()->destroyCamera(name + "_CAMERA");	
+}
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp	(revision 2265)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreCausticCasterRenderTechnique.cpp	(revision 2320)
@@ -56,5 +56,5 @@
 OgreCausticCasterRenderTechnique::~OgreCausticCasterRenderTechnique()
 {
-
+	MaterialManager::getSingleton().remove(causticMapMaterialName);
 }
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreFireRenderTechnique.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreFireRenderTechnique.cpp	(revision 1055)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/RenderTechniques/OgreFireRenderTechnique.cpp	(revision 2320)
@@ -68,4 +68,10 @@
 	mrt->update();
 	sm->setFindVisibleObjects(true);
+}
+
+FireRenderTarget::~FireRenderTarget()
+{
+	TextureManager::getSingleton().remove("ILLUM_FIRE_COLOR_TEXTURE");
+	TextureManager::getSingleton().remove("ILLUM_FIRE_HEAT_TEXTURE");
 }
 
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp	(revision 2265)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreSharedRuns.cpp	(revision 2320)
@@ -1,4 +1,27 @@
 #include "..\include\OgreSharedRuns.h"
 #include "OgreIlluminationManager.h"
+
+void OgreSharedRuns::freeAllResources()
+{
+	if(child1 != 0)//node
+	{
+		child1->freeAllResources();
+		child2->freeAllResources();
+	}	
+	else //leaf
+	{
+		std::map<RenderingRunType, RenderingRun*>::iterator it = sharedRuns.begin();
+		std::map<RenderingRunType, RenderingRun*>::iterator itend = sharedRuns.end();
+		while(it != itend)
+		{
+			RenderingRun* rr = (*it).second;
+			rr->freeAllResources();
+	//		sharedRuns.erase(it);
+			delete rr->asOgreRenderingRun();
+			++it;
+		}
+		sharedRuns.clear();
+	}
+}
 
 void OgreSharedRuns::runChanged(RenderingRunType runType, RenderingRun* run)
Index: GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 2285)
+++ GTP/trunk/Lib/Illum/IllumModule/OgreIllumModule/src/OgreIlluminationManager.cpp	(revision 2320)
@@ -181,4 +181,89 @@
 }
 
+void OgreIlluminationManager::freeAllResources()
+{
+	std::list<SharedRuns*>::iterator srit = this->sharedRunRoots.begin();
+	std::list<SharedRuns*>::iterator sritend = this->sharedRunRoots.end();
+	while(srit != sritend)
+	{
+		(*srit)->freeAllResources();
+		srit++;
+	}
+	sharedRunRoots.clear();
+
+	this->sharedRunRoots.clear();
+
+	this->globalSharedRuns.freeAllResources();
+		
+	std::map<String, OgreSharedRuns*>::iterator lrit = this->perLightRuns.begin();
+	std::map<String, OgreSharedRuns*>::iterator lritend = this->perLightRuns.end();
+
+	while(lrit != lritend)
+	{
+		OgreSharedRuns* lightRuns = ((*lrit).second);
+		perLightRuns.erase(lrit);
+		lightRuns->freeAllResources();
+		delete lightRuns;
+		lrit++;
+	}
+	perLightRuns.clear();
+
+	std::map<enum GlobalTargetType, GlobalUseRenderTarget*>::iterator grtit = this->globalTargets.begin();
+	std::map<enum GlobalTargetType, GlobalUseRenderTarget*>::iterator grtitend = this->globalTargets.end();
+	while(grtit != grtitend)
+	{
+		GlobalUseRenderTarget* rt = (*grtit).second;
+		globalTargets.erase(grtit);
+		delete rt;
+		grtit++;
+	}
+
+	this->pathMapClusters.clear();
+	this->pathMapEntryPoints.clear();
+
+	//delete rendertechniquegroups and cloned materials
+	SceneManager::MovableObjectIterator it = Root::getSingleton()._getCurrentSceneManager()
+													->getMovableObjectIterator("Entity");
+	while(it.hasMoreElements())
+	{
+		MovableObject* o = it.getNext();
+		Entity* e = (Entity*) o;
+		
+		if( e->getParentSceneNode() == 0 )//Entity not attached
+		break;
+
+		for(unsigned int s = 0; s < e->getNumSubEntities(); s++)
+		{
+			SubEntity* sube = e->getSubEntity(s);
+
+			Material* mat = sube->getMaterial().getPointer();
+
+			for(unsigned int t = 0 ; t < mat->getNumTechniques() ; t++)
+			{
+				Technique* tech = mat->getTechnique(t);
+
+				for(unsigned int p = 0; p< tech->getNumPasses(); p++)
+				{
+					Pass* pass = tech->getPass(p);
+
+					std::vector<IllumTechniqueParams*>& techniques = pass->getIllumTechniques();
+					if( techniques.size() > 0)
+					{
+						OgreTechniqueGroup* tg =  (OgreTechniqueGroup*) sube->getRenderTechniqueGroup();
+						delete tg;
+						sube->setRenderTechniqueGroup(0);
+					}
+				}
+			}
+
+			MaterialManager::getSingleton().remove(mat->getName());
+		}
+	}
+
+	
+
+	
+}
+
 void OgreIlluminationManager::initTechniques(Entity* e)
 {
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/SharedRuns.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/SharedRuns.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/SharedRuns.h	(revision 2320)
@@ -175,4 +175,6 @@
 	*/
 	virtual void unbindAndKillParent(){delete parent; parent = 0;}
+
+	virtual void freeAllResources()=0;
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/CausticCubeMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/CausticCubeMapRenderingRun.h	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/CausticCubeMapRenderingRun.h	(revision 2320)
@@ -22,4 +22,6 @@
 								unsigned int resolution,
 								bool updateAllFace);
+
+	virtual ~CausticCubeMapRenderingRun(){}
 
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/ChildPSystemRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/ChildPSystemRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/ChildPSystemRenderingRun.h	(revision 2320)
@@ -29,4 +29,6 @@
 	}
 
+	virtual ~ChildPsystemRenderingRun(){}
+
 protected:
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/DepthShadowMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/DepthShadowMapRenderingRun.h	(revision 874)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/DepthShadowMapRenderingRun.h	(revision 2320)
@@ -23,4 +23,6 @@
 		this->resolutionY = resolutionY;
 	}
+
+	virtual ~DepthShadowMapRenderingRun(){}
 
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/ReducedCubeMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/ReducedCubeMapRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/ReducedCubeMapRenderingRun.h	(revision 2320)
@@ -33,4 +33,6 @@
 
 	
+	virtual ~ReducedCubeMapRenderingRun(){}
+
 protected:
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/SceneCameraDepthRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/SceneCameraDepthRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/SceneCameraDepthRenderingRun.h	(revision 2320)
@@ -18,4 +18,6 @@
 	}
 
+	virtual ~SceneCameraDepthRenderingRun(){}
+
 protected:
     
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/CubeMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/CubeMapRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/CubeMapRenderingRun.h	(revision 2320)
@@ -33,4 +33,5 @@
 								bool renderEnvironment);
 
+	virtual ~CubeMapRenderingRun(){}
 	
 protected:
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/LightVolumeRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/LightVolumeRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/LightVolumeRenderingRun.h	(revision 2320)
@@ -30,4 +30,6 @@
 	}
 
+	virtual ~LightVolumeRenderingRun(){}
+
 protected:
     //inherited
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/PhaseTextureRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/PhaseTextureRenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/PhaseTextureRenderingRun.h	(revision 2320)
@@ -28,4 +28,6 @@
 	}
 
+	virtual ~PhaseTextureRenderingRun(){}
+
 protected:
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/PhotonMapRenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/PhotonMapRenderingRun.h	(revision 780)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRuns/PhotonMapRenderingRun.h	(revision 2320)
@@ -24,4 +24,6 @@
 	}
 
+	virtual ~PhotonMapRenderingRun(){}
+
 protected:
     //inherited
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/SBBRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/SBBRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/SBBRenderTechnique.h	(revision 2320)
@@ -20,4 +20,4 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~SBBRenderTechnique();	
+	virtual ~SBBRenderTechnique();	
 };
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DistanceCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DistanceCubeMapRenderTechnique.h	(revision 2285)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DistanceCubeMapRenderTechnique.h	(revision 2320)
@@ -41,5 +41,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~DistanceCubeMapRenderTechnique();
+	virtual ~DistanceCubeMapRenderTechnique();
 	
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/HierarchicalParticleSystemTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/HierarchicalParticleSystemTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/HierarchicalParticleSystemTechnique.h	(revision 2320)
@@ -32,5 +32,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~HierarchicalParticleSystemTechnique();
+	virtual ~HierarchicalParticleSystemTechnique();
 
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/IllumVolumeRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/IllumVolumeRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/IllumVolumeRenderTechnique.h	(revision 2320)
@@ -34,5 +34,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~IllumVolumeRenderTechnique();
+	virtual ~IllumVolumeRenderTechnique();
 
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ColorCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ColorCubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ColorCubeMapRenderTechnique.h	(revision 2320)
@@ -41,5 +41,5 @@
 								TechniqueGroup* parentTechniqueGroup
 								);
-	~ColorCubeMapRenderTechnique();
+	virtual ~ColorCubeMapRenderTechnique();
 	
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ConvolvedCubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ConvolvedCubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/ConvolvedCubeMapRenderTechnique.h	(revision 2320)
@@ -43,5 +43,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~ConvolvedCubeMapRenderTechnique();
+	virtual ~ConvolvedCubeMapRenderTechnique();
 	
 	/**
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CubeMapRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CubeMapRenderTechnique.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CubeMapRenderTechnique.h	(revision 2320)
@@ -41,5 +41,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~CubeMapRenderTechnique();
+	virtual ~CubeMapRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CausticCasterRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CausticCasterRenderTechnique.h	(revision 2285)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CausticCasterRenderTechnique.h	(revision 2320)
@@ -32,5 +32,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~CausticCasterRenderTechnique();
+	virtual ~CausticCasterRenderTechnique();
 	
 	//inherited
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DepthShadowReceiverRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DepthShadowReceiverRenderTechnique.h	(revision 2285)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/DepthShadowReceiverRenderTechnique.h	(revision 2320)
@@ -18,5 +18,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~DepthShadowReceiverRenderTechnique();	
+	virtual ~DepthShadowReceiverRenderTechnique();	
 	
 protected:		
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CausticReceiverRenderTechnique.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CausticReceiverRenderTechnique.h	(revision 2285)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderTechniques/CausticReceiverRenderTechnique.h	(revision 2320)
@@ -18,5 +18,5 @@
 							TechniqueGroup* parentTechniqueGroup
 							);
-	~CausticReceiverRenderTechnique();	
+	virtual ~CausticReceiverRenderTechnique();	
 	
 protected:		
Index: GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h
===================================================================
--- GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h	(revision 2240)
+++ GTP/trunk/Lib/Illum/IllumModule/IllumModule/include/RenderingRun.h	(revision 2320)
@@ -54,4 +54,6 @@
 	virtual bool canJoin(RenderingRun* run){return true;}
 
+	virtual void freeAllResources()=0;
+
 protected:
 
