[Libreoffice-commits] core.git: svl/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 13 13:19:05 UTC 2019
svl/source/inc/poolio.hxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit 0725e8a5d9add88b1289f5b1cb90b0b43059a734
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon May 13 11:07:28 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon May 13 15:18:22 2019 +0200
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 at collabora.co.uk>
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);
}
};
More information about the Libreoffice-commits
mailing list