tdf#125215 Assertion when closing Database/Advanced Settings

This showed up as a segfault for me.

Sometimes we have sortable items, for which we store duplicates (because
those items are not poolable), in which case comparing by operator==
means that we sometimes end up deleting the wrong one.

Change-Id: Ic7dff0357d3c5a7a74bf0b4e87fa02f2f5857f30
Reviewed-on: https://gerrit.libreoffice.org/72222
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2019-05-13 15:18:22 +02:00
parent 9cbb98456a
commit 0725e8a5d9
+3 -2
View File
@@ -133,7 +133,8 @@ public:
assert(false && "did not find item?");
break;
}
if (**sortIt == *pNeedle)
// need to compare by pointer here, since we might have duplicates
if (*sortIt == pNeedle)
{
maSortablePoolItems.erase(sortIt);
break;
@@ -141,7 +142,7 @@ public:
++sortIt;
}
}
return maPoolItemSet.erase(it);
maPoolItemSet.erase(it);
}
};