Bugfix ... remove deallocated object from map.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18002 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-10-29 07:01:13 +00:00
parent 6aef871f82
commit e1fd264d4f
2 changed files with 27 additions and 2 deletions

View file

@ -241,6 +241,25 @@ GSCurrentServer(void)
- (void) dealloc
{
NSMapEnumerator enumerator;
void *key;
void *val;
/*
* Remove the display server from the windows map.
* This depends on a property of GNUstep map tables, that an
* enumerated object can safely be removed from the map.
*/
enumerator = NSEnumerateMapTable(windowmaps);
while (NSNextMapEnumeratorPair(&enumerator, &key, &val))
{
if (val == (void*)self)
{
NSMapRemove(windowmaps, key);
}
}
NSEndMapTableEnumeration(&enumerator);
DESTROY(server_info);
DESTROY(event_queue);
NSFreeMapTable(drag_types);