Crashes in updated KnownPluginList::removeType

In this code here:

void KnownPluginList::removeType (const PluginDescription& type)
{
    {
        ScopedLock lock (typesArrayLock);

        for (auto& desc : types)
            if (desc.isDuplicateOf (type))
                types.remove (&desc);
    }

    sendChangeMessage();
}

You should not modify an Array while iterating over it. It probably should be:

void KnownPluginList::removeType (const PluginDescription& type)
{
    {
        ScopedLock lock (typesArrayLock);

        for (int i = types.size(); --i >= 0;)
            if (types[i].isDuplicateOf (type))
                types.remove (i);
    }

    sendChangeMessage();
}
2 Likes

I’ll get that sorted, thanks.

1 Like