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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #14488: NSUndoManager doesn't retain invocation.

Submitted by:  None
Submitted on:  Sat 10 Sep 2005 04:00:59 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Quentin Mathé <qmathe>
Open/Closed: Closed

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>
Project MemberIn charge of this item.
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>
Project 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

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 17 Sep 2005 09:48:36 PM UTCqmatheStatusNone=>Fixed
  Assigned togcasa=>qmathe
  Open/ClosedOpen=>Closed
Tue 13 Sep 2005 12:47:06 PM UTCgcasaAssigned toNone=>gcasa

Back to the top


Powered by Savane 3.1-cleanup1