From: havoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Thu, 22 May 2008 23:10:55 +0000 (+0000)
Subject: don't try to free r_texture_whitecube just because it's stored in one of
X-Git-Tag: xonotic-v0.1.0preview~2231
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a76e2d5ce65d41a9a4a3273bd32ef86ecf317c90;p=xonotic%2Fdarkplaces.git

don't try to free r_texture_whitecube just because it's stored in one of
the cubemap references


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8309 d7cf8633-e32d-0410-b094-e92efae38249
---

diff --git a/r_shadow.c b/r_shadow.c
index eb324479..27b1ffb5 100644
--- a/r_shadow.c
+++ b/r_shadow.c
@@ -3435,7 +3435,8 @@ void R_Shadow_FreeCubemaps(void)
 	{
 		if (developer_loading.integer)
 			Con_Printf("unloading cubemap \"%s\"\n", cubemaps[i].basename);
-		R_FreeTexture(cubemaps[i].texture);
+		if (cubemaps[i].texture != r_texture_whitecube)
+			R_FreeTexture(cubemaps[i].texture);
 	}
 
 	numcubemaps = 0;