shithub: choc

Download patch

ref: f3d57a518d6eb6453de292e76bafd014818bd480
parent: 31c0b0c7e1e9340145e11866c74e20ceddae77f9
author: Simon Howard <fraggle@soulsphere.org>
date: Sun Apr 26 19:07:21 EDT 2015

doom: Clear origin pointer when stopping sound.

When an mobj_t is freed, any currently-playing sounds attached to that
object are stopped, but the sound code was leaving a dangling pointer
to the freed mobj_t that was flagged by the -zonescan checks.

--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -174,11 +174,12 @@
                 break;
             }
         }
-        
+
         // degrade usefulness of sound data
 
         c->sfxinfo->usefulness--;
         c->sfxinfo = NULL;
+        c->origin = NULL;
     }
 }