commit f3d57a518d6eb6453de292e76bafd014818bd480
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sun Apr 26 23:07:21 2015 -0400
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Sun Apr 26 23:07:21 2015 -0400
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.
---
src/doom/s_sound.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c
index f6d8be13..5834650d 100644
--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -174,11 +174,12 @@ static void S_StopChannel(int cnum)
break;
}
}
-
+
// degrade usefulness of sound data
c->sfxinfo->usefulness--;
c->sfxinfo = NULL;
+ c->origin = NULL;
}
}