When setting the maximum voices limit Engine::pDimRegionPool and Engine::pDimRegionPool are
deleted (engines/gig/Engine.cpp:2134) but if there are already sampler channels connected to audio
devices they continue to use the pointers to the memory now freed (pDimRegionsInUse uses the freed
pools - engines/gig/EngineChannel.cpp:298)
Note: to reproduce this bug load instrument to a sampler channel, change the
maximum voice limit and start playing notes.
Created attachment 47 [details]
The patch works fine for me, but I think the ClearDimRegionsInUse part is
(In reply to comment #3)
> The patch works fine for me, but I think the ClearDimRegionsInUse part is
If you set the maximum voice limit while there are active streams
pDimRegionsInUse will not be empty and, if you delete pDimRegionPool before
clearing/deleting pDimRegionsInUse, in its destructor pDimRegionsInUse will try
to push back the elements in the list to pDimRegionPool, which is already
deleted. So in this case a memory corruption will occur.
See bug #120 before testing this scenario.
(In reply to comment #4)
Ah, you're right of course. This is the part I missed when I looked at the code
> its destructor pDimRegionsInUse will try
> to push back the elements in the list to pDimRegionPool
Applied the patch.