I've noticed that the Sound Source associated with a signal is never removed once created. After an hour's running of a route that has hundreds of signals, like Briscard, you can end up with 200 or more inactive signal Sound Sources. These, of course, just add to unnecessary resource consumption in the Sound Update process. Looking at the code of signals.cs I notice that these Sound Sources are supposedly IDisposable. However, I have inserted a trace in the Dispose method and it is never entered. A very similar setup, it seems, is a level crossing Sound Source and that does get removed after being inactive for a while.
I can't see why the signal Sound Sources are never removed. Any ideas from the C# gurus amongst you?
Dennis
Edit:
Sorry, this has been happening for all releases for months.
Page 1 of 1
Sound Source associated with a signal is never removed
#2
Posted 13 December 2014 - 03:22 AM
Being IDisposable or not makes no difference to whether something is collected, although I do think it's a bad idea in a game. In any case, something must be hanging on to the sound sources... let me look.
#4
Posted 13 December 2014 - 04:39 AM
#5
Posted 13 December 2014 - 02:03 PM
dennisat, on 13 December 2014 - 04:39 AM, said:
I'll be trying it as soon as I've completed today's duties -
Haven't had a lot of time to try the fix but what I've seen indicates a major improvement. So far, there appear to be no sounds lingering beyond their sell by date. I'll try and get a few more tests in tomorrow.
Dennis
#6
Posted 13 December 2014 - 02:10 PM
#7
Posted 15 December 2014 - 07:47 AM
I've done quite a few tests on this fix now and the problem is completely resolved as far as I'm concerned.
Thanks again for the quick fix.
Dennis
Thanks again for the quick fix.
Dennis
Page 1 of 1