summaryrefslogtreecommitdiff
path: root/sw/inc/ring.hxx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-02-13 15:57:32 +0100
committerMichael Stahl <mstahl@redhat.com>2015-02-16 22:26:45 +0100
commit6c92e54a3abcaa1d8f5d83d74dfb0b77415be1d3 (patch)
treecbe8ecabb5729d214683dea9df8f1c09af47f8d0 /sw/inc/ring.hxx
parent54e93460a53629c9428d3ed129a32f052b6bdd7e (diff)
sw: work around buggy boost::intrusive::circular_list_algorithms::unlink()
Boost is clearly following the C++ tradition of surprising omissions. Change-Id: I205ef17f87b176da938ebfa3e1a0748e94605daf
Diffstat (limited to 'sw/inc/ring.hxx')
-rw-r--r--sw/inc/ring.hxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sw/inc/ring.hxx b/sw/inc/ring.hxx
index 9f70061e9725..f6aac23eda4a 100644
--- a/sw/inc/ring.hxx
+++ b/sw/inc/ring.hxx
@@ -43,7 +43,14 @@ namespace sw
typedef RingContainer<value_type> ring_container;
typedef RingContainer<const_value_type> const_ring_container;
virtual ~Ring()
- { algo::unlink(this); };
+ { unlink(); };
+ /** algo::unlink is buggy! don't call it directly! */
+ void unlink()
+ {
+ algo::unlink(this);
+ pNext = this; // don't leave pointers to old list behind!
+ pPrev = this;
+ }
/**
* Removes this item from its current ring container and adds it to
* another ring container. If the item was not alone in the original
@@ -135,7 +142,7 @@ namespace sw
inline void Ring<value_type>::MoveTo(value_type* pDestRing)
{
value_type* pThis = static_cast< value_type* >(this);
- algo::unlink(pThis);
+ unlink();
// insert into "new"
if (pDestRing)
{