X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/74b57569a3caaf8758b616f8259b154dcaf1c651..9bd5c5fcda3fe2222bf37f1615961516d6b40e7f:/include/wx/cocoa/ObjcRef.h diff --git a/include/wx/cocoa/ObjcRef.h b/include/wx/cocoa/ObjcRef.h index ff1416e26e..d8361c62c3 100644 --- a/include/wx/cocoa/ObjcRef.h +++ b/include/wx/cocoa/ObjcRef.h @@ -2,7 +2,7 @@ // Name: wx/cocoa/ObjcRef.h // Purpose: wxObjcAutoRef template class // Author: David Elliott -// Modified by: +// Modified by: // Created: 2004/03/28 // RCS-ID: $Id$ // Copyright: (c) 2004 David Elliott @@ -13,7 +13,7 @@ #define _WX_COCOA_OBJCREF_H__ // Reuse wxCFRef-related code (e.g. wxCFRetain/wxCFRelease) -#include "wx/mac/corefoundation/cfref.h" +#include "wx/osx/core/cfref.h" // NOTE WELL: We can only know whether or not GC can be used when compiling Objective-C. // Therefore we cannot implement these functions except when compiling Objective-C. @@ -47,7 +47,7 @@ wxGCSafeRelease(m_obj); // release current object (if any) m_obj = wxGCSafeRetain([[NSObject alloc] init]); [m_obj release]; // balance alloc - + Consider the effect on the retain count from each statement (alloc, CFRetain, release) In RR mode: retainCount = 1, +1, -1 In GC mode: strongRetainCount = 0, +1, -0 @@ -99,10 +99,10 @@ inline void wxGCSafeRelease(Type *r) #else // NOTE: When not compiling Objective-C, declare these functions such that they can be // used by other inline-implemented methods. Since those methods in turn will not actually -// be used from non-ObjC code the compiler ought not to emit them. If it emits an out -// of line copy of functions using these functions then presumably it will have also emitted -// in at least one source file an out of line copy of these functions and there will be -// no problem at link time. +// be used from non-ObjC code the compiler ought not emit them. If it emits an out of +// line copy of those methods then presumably it will have also emitted at least one +// out of line copy of these functions from at least one Objective-C++ translation unit. +// That means the out of line implementation will be available at link time. template inline Type * wxGCSafeRetain(Type *r); @@ -150,7 +150,7 @@ protected: it will use a method (currently CFRetain/CFRelease) to ensure the object will never be finalized until this object is destroyed. */ - + template class wxObjcAutoRefFromAlloc: wxObjcAutoRefBase {