bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #6226] Segmentation fault when application finishes


From: nobody
Subject: [bug #6226] Segmentation fault when application finishes
Date: Tue, 28 Oct 2003 18:45:34 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20031012 Mozilla Firebird/0.6.1

=================== BUG #6226: FULL BUG SNAPSHOT ===================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=6226&group_id=99

Submitted by: benhur                  Project: GNUstep                      
Submitted on: Tue 10/28/2003 at 21:45
Category:  Gui/AppKit                 Severity:  2                          
Bug Group:  Bug                       Resolution:  None                     
Assigned to:  None                    Status:  Open                         

Summary:  Segmentation fault when application finishes

Original Submission:  Some applications generate a segmentation fault when 
finishing.

It goes like this:



NSApplication -dealloc releases the GSDisplayServer associated

to _app_icon_window. It gets deallocated.



NSResponder (NSApplication's super) -dealloc releases _menu



menu releases it's window.



NSWindow's dealloc calls GSServerForWindow(self) and obtains a pointer to the 
deallocated server.

NSWindow sends removeDragTypes:fromWindow to this deallocated object... boom!



The problem is that there is a NSMapTable to map windows to 

DisplayServers, and this map doesn't get updated when a displayserver is 
deallocated.



Adding the following method to GSDisplayServer and calling it from -dealloc 
solves the problem.



Benhur





- (void) _removeFromWindowMap

{

  NSMapEnumerator enumerator;

  void *key;

  void *val;



  enumerator = NSEnumerateMapTable(windowmaps);

  while (NSNextMapEnumeratorPair(&enumerator, &key, &val))

    {

      if (val == self)

        {

          NSMapRemove(windowmaps, key);

        }

    }

  NSEndMapTableEnumeration(&enumerator);

}







No Followups Have Been Posted


CC list is empty


No files currently attached


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=6226&group_id=99

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]