summaryrefslogtreecommitdiff
path: root/Objective-C/libobjcl.m
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-10 14:46:54 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-10 14:46:54 +0100
commit3170b6d37b051f42fe0b28ba2dfa54344e1c85e6 (patch)
tree630d20e53eb35af86c4274e0ebccb35d492155d1 /Objective-C/libobjcl.m
parent7d44a3313c9be065f962975b362d29684bcd3418 (diff)
Add NSObject category ObjectiveCLWrapperLink.
darcs-hash:0a90de7a76127351a989662a577b5688fe39654c
Diffstat (limited to 'Objective-C/libobjcl.m')
-rw-r--r--Objective-C/libobjcl.m39
1 files changed, 25 insertions, 14 deletions
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index c75ebea..94a3663 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -18,6 +18,7 @@
*/
#import "libobjcl.h"
+#import "NSObject-ObjectiveCLWrapperLink.h"
#import "PyObjC/libffi_support.h"
#import "JIGS/ObjcRuntimeUtilities.h"
@@ -79,25 +80,33 @@ objcl_initialise_runtime (void)
if (!method_list_lengths)
method_list_lengths = [[NSMutableDictionary alloc] init];
+
+ objcl_initialise_instance_wrappers ();
}
-void
-objcl_shutdown_runtime (void)
+static void
+release_unless_null (id *object)
{
- if (objcl_autorelease_pool)
+ if (*object)
{
- [objcl_autorelease_pool release];
- objcl_autorelease_pool = NULL;
- }
- if (objcl_oom_exception)
- {
- [objcl_oom_exception release];
- objcl_oom_exception = NULL;
+ [*object release];
+ *object = NULL;
}
}
+void
+objcl_shutdown_runtime (void)
+{
+ release_unless_null (&objcl_autorelease_pool);
+ release_unless_null (&objcl_oom_exception);
+ release_unless_null (&method_lists);
+ release_unless_null (&method_list_lengths);
+ objcl_shutdown_instance_wrappers ();
+}
+
+
#ifdef USE_LIBFFI
id
objcl_invoke_with_types (int argc,
@@ -661,14 +670,16 @@ objcl_create_class (const char *class_name,
objcl_alignof_type (ivar_typespecs[i]),
ivar_typespecs[i]);
+#ifdef __OBJC2__
+ /* FIXME: What to do for the NeXT Objective-C 1.0 and GNU runtimes
+ here? */
for (i = 0; i < protocol_number; i++)
preclass_addProtocol (class,
-#ifdef __OBJC2__
objc_getProtocol ((char *) protocol_names[i])
-#else
- objc_getClass (protocol_names[i])
-#endif
+ /* ??? !__OBJC2__ ???
+ objc_getClass (protocol_names[i]) */
);
+#endif
return class;
#else