X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a24aa4279a8ef9c25b7d0a512a1def0d823ef8f7..7d6a4d96961eac84d05db8bb24c64d39003f6e54:/src/cocoa/NSControl.mm?ds=sidebyside diff --git a/src/cocoa/NSControl.mm b/src/cocoa/NSControl.mm index 1e6a632de7..0bcac4f44b 100644 --- a/src/cocoa/NSControl.mm +++ b/src/cocoa/NSControl.mm @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: cocoa/NSControl.cpp +// Name: src/cocoa/NSControl.mm // Purpose: wxCocoaNSControl // Author: David Elliott // Modified by: // Created: 2003/02/15 -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWidgets licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -23,6 +23,7 @@ #endif // WX_PRECOMP #include "wx/cocoa/objc/objc_uniquifying.h" +#include "wx/cocoa/ObjcRef.h" #include "wx/cocoa/NSControl.h" #import @@ -56,5 +57,8 @@ WX_IMPLEMENT_GET_OBJC_CLASS(wxNSControlTarget,NSObject) // ============================================================================ WX_IMPLEMENT_OBJC_INTERFACE(NSControl) -struct objc_object *wxCocoaNSControl::sm_cocoaTarget = [[WX_GET_OBJC_CLASS(wxNSControlTarget) alloc] init]; +// New CF-retained observer (this should have been using wxObjcAutoRefFromAlloc to begin with) +wxObjcAutoRefFromAlloc s_cocoaNSControlTarget = [[WX_GET_OBJC_CLASS(wxNSControlTarget) alloc] init]; +// For compatibility with old code +struct objc_object *wxCocoaNSControl::sm_cocoaTarget = s_cocoaNSControlTarget;