From: vortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Fri, 29 Oct 2010 17:54:59 +0000 (+0000)
Subject: oops, video texture unlinking was accidentally removed, restore it
X-Git-Tag: xonotic-v0.1.0preview~89
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d90d89fa0481654e747908f5ce3074cc27d40272;p=xonotic%2Fdarkplaces.git

oops, video texture unlinking was accidentally removed, restore it

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10568 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=8aecffa298082cc5daaf6f8ac0a44aa9d306c832
---

diff --git a/cl_video.c b/cl_video.c
index 2d3e6d0d..e234700c 100644
--- a/cl_video.c
+++ b/cl_video.c
@@ -62,6 +62,7 @@ static void UnlinkVideoTexture( clvideo_t *video ) {
 	CL_UnlinkDynTexture( video->cpif.name );
 	// free the texture
 	R_FreeTexture( video->cpif.tex );
+	video->cpif.tex = NULL;
 	// free the image data
 	Mem_Free( video->imagedata );
 }
@@ -598,7 +599,12 @@ static void cl_video_start( void )
 
 static void cl_video_shutdown( void )
 {
-	// TODO: unlink video textures?
+	int i;
+	clvideo_t *video;
+
+	for( video = cl_videos, i = 0 ; i < cl_num_videos ; i++, video++ )
+		if( video->state != CLVIDEO_UNUSED && !video->suspended )
+			SuspendVideo( video );
 	R_FreeTexturePool( &cl_videotexturepool );
 }