summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-13 11:07:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-13 15:18:22 +0200
commit0725e8a5d9add88b1289f5b1cb90b0b43059a734 (patch)
tree14a928abace3ca73360403477d472b7ed0f54e07 /svl
parent9cbb98456a054b6b02e96c9d29f1b931893d4aed (diff)
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>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/inc/poolio.hxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 2939d50aaf2f..971fb86c9b1d 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -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);
}
};