bugGNUstep - Bugs: bug #14488, NSUndoManager doesn't retain...

Group
 
 

bug #14488: NSUndoManager doesn't retain invocation.

Submitter:  None
Submitted:  Sat 10 Sep 2005 04:00:59 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  qmathe
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 17 Sep 2005 09:48:36 PM UTC, comment #4: 

Fixed in cvs now.

2005-09-17  Saso Kiselkov <diablos@manga.sk>
       
        * Headers/Foundation/NSInvocation.h:

  • Source/NSInvocation.m:

        (-targetRetained, -retainArgumentsIncludingTarget:):
        Added new methods which allow target to be not retained when arguments
        are and to check whether it is retained or not (-retainsArguments code
        moved in -retainArgumentsIncludingTarged and simplified by removing a
        redundant nested branch statement).
        * Source/NSUndoManager.m (-forwardInvocation:,
        -registerUndoWithTarget:selector:object:): Fixed bug #14488 by relying
        on previous new methods to retain undo invocation (taking in account
        the fact arguments may have been released before it is called).
        Patch committed by Quentin Mathe.

Quentin Mathé <qmathe>
Group Member
Tue 13 Sep 2005 05:18:53 PM UTC, comment #3: 

We've already investigated in the mean time together with Quentin - the correct (Cocoa-conforming) solution. In Cocoa there is a special subclass called _NSUndoInvocation which retains it's arguments doesn't retain the target, as retaining the target would result in a retain-loop (the target of undo operations is usually the same object as the one which owns the undo manager).

I've created a fix for this bug by modifying NSInvocation to include a method named -retainArgumentsIncludingTarget: where the sender can explicitly define whether or not retain the target, and also modified NSUndoManager.m to use it. Quentin should put it into CVS some time soon. The fix is available at http://openspace.adlerka.sk/NSUndoManagerFix.tar.gz .

Sašo Kiselkov <diablos>
Tue 13 Sep 2005 12:47:06 PM UTC, comment #2: 

I am going to test this on Mac OS X/Cocoa to see if the behavior is similar there.

Gregory John Casamento <gcasa>
Group administrator
Sat 10 Sep 2005 04:06:14 PM UTC, comment #1: 

I've found a bug in the NSUndoManager code which caused my app to crash. NSUndoManager doesn't tell the invocation to retain it's arguments when doing invocation-based undo. The patch is as simple as adding

[anInvocation retainArguments];

into the method -[NSUndoManager forwardInvocation:].

Sašo Kiselkov <diablos>
Sat 10 Sep 2005 04:00:59 PM UTC, original submission:  


Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-09-17 qmathe StatusNone Fixed
    Assigned togcasa qmathe
    Open/ClosedOpen Closed
2005-09-13 gcasa Assigned toNone gcasa

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code