diff --git a/Documentation/advertisement.texi b/Documentation/advertisement.texi index f2be96851..e30510f46 100644 --- a/Documentation/advertisement.texi +++ b/Documentation/advertisement.texi @@ -169,9 +169,9 @@ It is known not to work with: @section Now and Future -The current version is 0.1; the low number indicates that the library is -still in flux. A version coming soon will include String objects and -better allocation/dealocation conventions. +The current version is @value{OBJECTS_VERSION} the low number indicates +that the library is still in flux. A version coming soon will include +String objects and better allocation/dealocation conventions. @section GNUStep, NEXTSTEP and OpenStep diff --git a/Headers/gnustep/base/Retaining.h b/Headers/gnustep/base/Retaining.h index 674ba8dbc..30b1f9d9d 100644 --- a/Headers/gnustep/base/Retaining.h +++ b/Headers/gnustep/base/Retaining.h @@ -88,7 +88,12 @@ Due to this delayed release, the function that receives the object as a return value will have the opportunity to retain the object before the "release" instigated by the "autorelease" actually - takes place. */ + takes place. + + For the object to be autoreleased, you must have previously created + a AutoreleasePool or an AutoreleaseStack. If you don't, however, + your program won't crash, the release corresponding to the + autorelease will just never happen. */ @end diff --git a/Source/NSObject.m b/Source/NSObject.m index dec964715..bed833564 100644 --- a/Source/NSObject.m +++ b/Source/NSObject.m @@ -1,8 +1,8 @@ +#include #include #include #include #include -#include "objc/objc-api.h" @implementation NSObject diff --git a/Source/ObjectRetaining.m b/Source/ObjectRetaining.m index ce5513a77..7ab7a66b2 100644 --- a/Source/ObjectRetaining.m +++ b/Source/ObjectRetaining.m @@ -25,6 +25,7 @@ #include #include #include +#include #include /* Doesn't handle multi-threaded stuff. @@ -34,7 +35,7 @@ static coll_cache_ptr retain_counts = NULL; /* The Class responsible for handling autorelease's */ -static id autorelease_class = nil; +id autorelease_class = nil; static void init_retain_counts_if_necessary() @@ -94,12 +95,6 @@ objc_retain_count (id anObj) return 0; } -void -objc_set_autorelease_class (id the_autorelease_class) -{ - auto_release_class = the_autorelease_class; -} - @implementation Object (RetainingObject) - retain @@ -125,8 +120,8 @@ objc_set_autorelease_class (id the_autorelease_class) - autorelease { - [the_autorelease_class addObject:self]; - returnself; + [autorelease_class autoreleaseObject:self]; + return self; } @end diff --git a/Source/Proxy.m b/Source/Proxy.m index ed338716d..5ae0824df 100644 --- a/Source/Proxy.m +++ b/Source/Proxy.m @@ -345,7 +345,7 @@ static inline BOOL class_is_kind_of(CLASS self, CLASS aClassObject) - autorelease { /* xxx Problems here if the Connection goes away? */ - [autorelease_class addObject:self]; + [autorelease_class autoreleaseObject:self]; return self; } diff --git a/Source/objects/Retaining.h b/Source/objects/Retaining.h index 674ba8dbc..30b1f9d9d 100644 --- a/Source/objects/Retaining.h +++ b/Source/objects/Retaining.h @@ -88,7 +88,12 @@ Due to this delayed release, the function that receives the object as a return value will have the opportunity to retain the object before the "release" instigated by the "autorelease" actually - takes place. */ + takes place. + + For the object to be autoreleased, you must have previously created + a AutoreleasePool or an AutoreleaseStack. If you don't, however, + your program won't crash, the release corresponding to the + autorelease will just never happen. */ @end diff --git a/Source/preface.m b/Source/preface.m index 8715f45f3..830eecd1d 100644 --- a/Source/preface.m +++ b/Source/preface.m @@ -1,4 +1,4 @@ -/* Support for general purpose definitions for the Collection Library. +/* Support for general purpose definitions for libobjects. Copyright (C) 1993,1994 Free Software Foundation, Inc. Written by: R. Andrew McCallum diff --git a/Source/stdobjects.m b/Source/stdobjects.m index 8715f45f3..830eecd1d 100644 --- a/Source/stdobjects.m +++ b/Source/stdobjects.m @@ -1,4 +1,4 @@ -/* Support for general purpose definitions for the Collection Library. +/* Support for general purpose definitions for libobjects. Copyright (C) 1993,1994 Free Software Foundation, Inc. Written by: R. Andrew McCallum