Reset some Timidity state on shutdown to prevent crash when reinitializing. stable-1.0
authorRyan C. Gordon <icculus@icculus.org>
Wed, 15 Jun 2011 16:02:09 -0400
branchstable-1.0
changeset 593 941847b13998
parent 592 f31f9ceddec9
child 594 b7b77ce74ac9
Reset some Timidity state on shutdown to prevent crash when reinitializing.

Fixes Bugzilla #1232.

Thanks to Ozkan Sezer for the patch!
(transplanted from e564b7029c2953ee918401dd9a3f2766cad1c6ca)
decoders/timidity/timidity.c
--- a/decoders/timidity/timidity.c	Wed Jun 15 16:01:08 2011 -0400
+++ b/decoders/timidity/timidity.c	Wed Jun 15 16:02:09 2011 -0400
@@ -594,6 +594,7 @@
         free(e);
       }
       free(master_tonebank[i]);
+      master_tonebank[i] = NULL;
     }
     if (master_drumset[i])
     {
@@ -608,6 +609,7 @@
         free(e);
       }
       free(master_drumset[i]);
+      master_drumset[i] = NULL;
     }
   }