bugGNUstep - Bugs: bug #24950, Calling [NSApplication init]...

Group
 
 

bug #24950: Calling [NSApplication init] mulitple times causes an NSException on GNUstep

Submitter:  Gregory John Casamento <gcasa>
Submitted:  Wed 26 Nov 2008 09:07:33 PM UTC
   
 
Category:  Gui/AppKit Severity:  2 - Minor
Item Group:  Change Request Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 13 Jan 2009 06:29:17 AM UTC, comment #2: 

I agree.  I'm closing this.  Thanks.

Gregory John Casamento <gcasa>
Group administrator
Fri 09 Jan 2009 09:32:45 AM UTC, comment #1: 

I just looked at our source, and read the comments about application startup ... and they sounded pretty convincing.  It really looks like our behavior is better than MacOS-X here and any applications which wrongly call init more than once could trivially be modified to call +sharedApplication instead.

Richard Frith-Macdonald <CaS>
Group Member
Wed 26 Nov 2008 09:07:33 PM UTC, original submission:  

On Mac OS X the following code does not cause an exception:

//
//  GSTableView.m
//  TestDesignatedInit
//
//  Created by Gregory Casamento on 11/23/08.
//  Copyright 2008 _MyCompanyName_. All rights reserved.
//

#import "GSTableView.h"


@implementation GSTableView
- (id) initWithFrame: (NSRect)frame
{
NSLog(@"initWithFrame was called.");
return [super initWithFrame: frame];
}

- (void) awakeFromNib
{
id app = [NSApplication init];
NSLog(@"Awake from nib called. %@",app);
app = [NSApplication init];
NSLog(@"Awake from nib called. %@",app);
app = [NSApplication init];
NSLog(@"Awake from nib called. %@",app);
}
@end

It appears to return the same singleton instance over and over.   While I  know we shouldn't call init multiple times, we should consider making it behave consistently with Cocoa.

GC

Gregory John Casamento <gcasa>
Group administrator

 

(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

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by gcasa (Submitted the item)
  •  

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-01-13 gcasa StatusNone Wont Fix
        Open/ClosedOpen Closed
    2008-12-07 gcasa Severity3 - Normal 2 - Minor

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code