(_NSAddHandler): When creating E_QUEUE, don't autorelease and then

retain; instead just allocate it un-autoreleased.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1568 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1996-05-28 18:27:40 +00:00
parent 48238c0cf9
commit 584559b8bf

View file

@ -20,13 +20,15 @@
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <assert.h>
#include <gnustep/base/preface.h>
#include <Foundation/NSException.h>
#include <Foundation/NSString.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSArray.h>
#include <Foundation/NSCoder.h>
#include <Foundation/NSValue.h>
#include <Foundation/NSDictionary.h>
#include <assert.h>
NSString *NSGenericException
= @"NSGenericException";
@ -175,12 +177,12 @@ _NSFoundationUncaughtExceptionHandler(NSException *exception)
void
_NSAddHandler( NSHandler *handler )
{
if (!e_queue) {
e_queue = [[NSMutableArray arrayWithCapacity:8] retain];
}
if (!e_queue)
e_queue = [[NSMutableArray alloc] initWithCapacity:8];
[e_queue addObject:
[NSValue value:&handler withObjCType:@encode(NSHandler *)]];
[NSValue value: &handler
withObjCType: @encode(NSHandler*)]];
}
void