From c8266dd238bf96738d2b2cb05b1d271492d61a6b Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Wed, 5 May 1993 13:51:43 +0000 Subject: [PATCH] (-shouldNotImplement:): New method (-shouldNotImplement:): New method (-free): assign [FREED class] to isa when freeing From-SVN: r4332 --- gcc/objc/Object.m | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gcc/objc/Object.m b/gcc/objc/Object.m index 79bbdd8..e6c90ec 100644 --- a/gcc/objc/Object.m +++ b/gcc/objc/Object.m @@ -27,6 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "objc/Protocol.h" #include "objc/objc-api.h" +@class FREED; + #include "gstdarg.h" extern void (*_objc_error)(id object, const char *format, va_list); @@ -58,6 +60,10 @@ extern int errno; - free { + static Class* freedClass = 0; + if (!freedClass) + freedClass = [FREED class]; + isa = freedClass; return object_dispose(self); } @@ -293,6 +299,11 @@ extern int errno; object_get_class_name(self), sel_get_name(aSel)]; } +- shouldNotImplement +{ + return [self error:"should not implement %s", sel_get_name(aSel)]; +} + - error:(const char *)aString, ... { #define FMT "error: %s (%s)\n%s\n" -- 2.7.4