bug-gnustep
[Top][All Lists]
Advanced

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

[bug #15313] multiple notification sent on button pushing


From: Richard Frith-Macdonald
Subject: [bug #15313] multiple notification sent on button pushing
Date: Tue, 10 Jan 2006 16:56:57 +0000
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/416.12 (KHTML, like Gecko) Safari/416.13

Update of bug #15313 (project gnustep):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #9:

I tried this ... it compiled, but when I ran it it immediately got an
exception because it was trying to send a -saveWindowCoordinates message to
TestWindow.
I wrote a dummy implementation of that method ... then the program ran.

The problem appears to be that you are not removing the observations you are
setting up, because the notification names you are using in the
addObserver... calls are not the same as the names you are using in the
removeObserver... calls.  This means that when subviews are destroyed, the
expanding view still has them registered, and when a new subview happens to
be created at the same location in memory and is registered as a notification
object, you effectively get the same object registered twice.

The fix is to remove the notification registrations properly in the
-removeExpandingSubview: method ... the simplest way to do that is

[[NSNotificationCenter defaultCenter] removeObserver: self name: nil object:
[sender object]];

Using nil as the notification name will remove self as an observer for all
notifications sent with that object.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=15313>

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





reply via email to

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