Hi,
Ivan Vučica wrote:
Have you tested this by creating a new non-constant NSString object,
printing out its -retainCount, using it as a key for NSMapInsert(),
then printing out its -retainCount again? (Or overriding -retain and
observing if it is called?)
Relevant code seems to live in 'NSConcreteMapTable.m' and 'GSIMap.h'.
no, testing was complicated because triggered only by error conditions.
My guess is that since an object is used as a "key", if for some reason
the object gets dealloc'd outside the map, the key becomes invalid (I
understand what while values do get retained on insertion, keys are not).
I thus decided to retain the key at every insertion and release it later
on removal. Seems to work, but since I found not a valid way to trigger
this bug (except for running GNUMail in gdb for hours) it is more a
theoretical fix.
Riccardo
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev