From: cloudwalk Date: Tue, 19 May 2020 18:52:55 +0000 (+0000) Subject: Reset r_shadow_occlusion_buf on vid_restart. Fixes query buffer dangling pointer X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d49e641a29b050a1caf9f54f991034efa4dbb0e2;p=xonotic%2Fdarkplaces.git Reset r_shadow_occlusion_buf on vid_restart. Fixes query buffer dangling pointer Basically, when coronas appear when r_coronas_occlusionquery is 1, the engine binds to a query buffer and stores a pointer to it in r_shadow_occlusion_buf. Upon vid_restart, somewhere along the way, the buffer is cleared but the original pointer is kept, resulting in a crash next time a corona appears. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12541 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 2897c78f..5d5f29c4 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -3085,6 +3085,8 @@ static void gl_main_start(void) #endif } +extern unsigned int r_shadow_occlusion_buf; + static void gl_main_shutdown(void) { R_RenderTarget_FreeUnused(true); @@ -3105,7 +3107,7 @@ static void gl_main_shutdown(void) #endif break; } - + r_shadow_occlusion_buf = 0; r_numqueries = 0; r_maxqueries = 0; memset(r_queries, 0, sizeof(r_queries));