Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp	(revision 2867)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.cpp	(revision 2878)
@@ -127,4 +127,11 @@
 
 
+ColorBufferObject::~ColorBufferObject()
+{
+	glDeleteRenderbuffersEXT(1, &mId);
+	glDeleteTextures(1, &mTexId);
+}
+
+
 FrameBufferObject::FrameBufferObject(int w, int h, DEPTH_FORMAT d, bool useDepthTex)
 : mWidth(w), mHeight(h), mDepthTexId(0)
@@ -187,4 +194,15 @@
 
 
+FrameBufferObject::~FrameBufferObject()
+{
+	glDeleteFramebuffersEXT(1, &mId);
+	glDeleteRenderbuffersEXT(1, &mDepthId);
+
+	if (mDepthTexId) glDeleteTextures(1, &mDepthTexId);
+
+	CLEAR_CONTAINER(mColorBuffers);
+}
+
+
 int FrameBufferObject::AddColorBuffer(ColorBufferObject::FORMAT col, 
 									  ColorBufferObject::WRAP_TYPE wrapType, 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp	(revision 2877)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneQuery.cpp	(revision 2878)
@@ -189,6 +189,5 @@
 	GrabDepthBuffer(mDepth, fbo->GetDepthTex());
 	
-	ExportDepthBuffer(mDepth); 
-	PrintGLerror("grab");
+	//ExportDepthBuffer(mDepth); PrintGLerror("grab");
 
 	DEL_PTR(fbo);
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2877)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp	(revision 2878)
@@ -539,5 +539,5 @@
 	// this fbo basicly stores the scene information we get from standard rendering of a frame
 	// we store colors, normals, positions (for the ssao)
-	fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_32);
+	fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_24);
 
 	// the diffuse color buffer
@@ -871,6 +871,4 @@
 	
 		glEnable(GL_MULTISAMPLE_ARB);
-		//glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
-
 		fbo->Release();
 
@@ -890,6 +888,4 @@
 
 		glEnable(GL_MULTISAMPLE_ARB);
-		//glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
-
 		fbo->Release();
 
@@ -912,6 +908,5 @@
 	case RenderState::DEFERRED:
 
-		// multisampling not working with deferred shading
-		//glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE_ARB);
+		// multisampling does not work with deferred shading
 		glDisable(GL_MULTISAMPLE_ARB);
 
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp	(revision 2864)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp	(revision 2878)
@@ -104,8 +104,6 @@
 			}
 			
-			if (!resultAvailable)
-				++ waitedForQueries;
-			++ returnedQueries;
-
+			//++ returnedQueries; if (!resultAvailable) ++ waitedForQueries;
+			
 			OcclusionQuery *query = mQueryQueue.front();
 			mQueryQueue.pop();
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h	(revision 2877)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrameBufferObject.h	(revision 2878)
@@ -27,4 +27,6 @@
 					  int attachment_idx);
 
+	~ColorBufferObject();
+
 	unsigned int GetTexture() const {return mTexId;}
 
@@ -47,4 +49,6 @@
 	*/
 	FrameBufferObject(int w, int h, DEPTH_FORMAT d, bool useDepthTex = false);
+	
+	~FrameBufferObject();
 	/** Creates and adds a color buffer to the current frame buffer object.
 		Returns the index that allows to retrieve the color buffer object.
Index: /GTP/trunk/App/Demos/Vis/FriendlyCulling/Readme.txt
===================================================================
--- /GTP/trunk/App/Demos/Vis/FriendlyCulling/Readme.txt	(revision 2862)
+++ /GTP/trunk/App/Demos/Vis/FriendlyCulling/Readme.txt	(revision 2878)
@@ -85,5 +85,4 @@
 DevIL for texture loading / unloading
 glfont2 (http://students.cs.byu.edu/~bfish/glfont2.php) for the antialiased fonts of the HUD. Thanks to the author Brad Fish. 
-The RenderTexture library. Thanks to the author Mark J. Harris.
 
 Thanks also to Alexander Kusternig for providing me his code for the SSAO shader.
