Commit c8266dd2 by Kresten Krab Thorup

(-shouldNotImplement:): New method

(-shouldNotImplement:): New method
(-free): assign [FREED class] to isa when freeing

From-SVN: r4332
parent 27f581c3
...@@ -27,6 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ...@@ -27,6 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "objc/Protocol.h" #include "objc/Protocol.h"
#include "objc/objc-api.h" #include "objc/objc-api.h"
@class FREED;
#include "gstdarg.h" #include "gstdarg.h"
extern void (*_objc_error)(id object, const char *format, va_list); extern void (*_objc_error)(id object, const char *format, va_list);
...@@ -58,6 +60,10 @@ extern int errno; ...@@ -58,6 +60,10 @@ extern int errno;
- free - free
{ {
static Class* freedClass = 0;
if (!freedClass)
freedClass = [FREED class];
isa = freedClass;
return object_dispose(self); return object_dispose(self);
} }
...@@ -293,6 +299,11 @@ extern int errno; ...@@ -293,6 +299,11 @@ extern int errno;
object_get_class_name(self), sel_get_name(aSel)]; 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, ... - error:(const char *)aString, ...
{ {
#define FMT "error: %s (%s)\n%s\n" #define FMT "error: %s (%s)\n%s\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment