Access violation in TMultiMap.Remove()

Issue #397 resolved
Markus created an issue

The following code throws an access violation on win32:

  var Obj := TObject.Create;
  var MultiMap := TCollections.CreateMultiMap<Integer, TObject>([doOwnsValues]);
  MultiMap.Add(0, Obj);
  MultiMap.Remove(0, Obj); // AV

I think that line 936 in Spring.Collections.MultiMaps.pas is the problem.

It should not free the “item” but the entry which is removed with

item.Values.Remove(value);

Comments (2)

  1. Log in to comment