← Back to team overview

mudlet-makers team mailing list archive

Re: [Bug 1094962] [NEW] Iterators are invalidated when removing lines from TBuffer.

 

This function is only used to delete a single element which is safe. 
Consequently, this hasn't been a practical issue, but it's a good call 
anyways. I've applied your patch. Thanks.


Am 31.12.2012 23:44, schrieb Ahmed Charles:
> Public bug reported:
>
> Calling erase invalidates the iterator passed to it and therefore, using
> that iterator again (like incrementing or dereferencing or passing it to
> a function) isn't allowed.
>
> The patch below also provides greater efficiency, since the elements
> that are not being removed don't move as much if lines are removed from
> the middle.
>
> ** Affects: mudlet
>       Importance: Undecided
>           Status: New
>
>
> ** Tags: crash perf
>
> ** Patch added: "Replace with the two iterator version of erase instead of looping."
>     https://bugs.launchpad.net/bugs/1094962/+attachment/3471619/+files/0001-Fix-iterator-invalidation-bug-in-TBuffer.patch
>

-- 
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
https://bugs.launchpad.net/bugs/1094962

Title:
  Iterators are invalidated when removing lines from TBuffer.

Status in Mudlet the MUD client:
  New

Bug description:
  Calling erase invalidates the iterator passed to it and therefore,
  using that iterator again (like incrementing or dereferencing or
  passing it to a function) isn't allowed.

  The patch below also provides greater efficiency, since the elements
  that are not being removed don't move as much if lines are removed
  from the middle.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mudlet/+bug/1094962/+subscriptions


References