X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c729f16fa54e8484d8600fcb423c0983d71abab2..2f70baea2fa2aa1fbcdceb0121eea1cb5c9bedf0:/src/osx/cocoa/textctrl.mm diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index f8e4f22bf2..b5913b841b 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -258,7 +258,12 @@ protected : - (void) setFieldEditor:(wxNSTextFieldEditor*) editor { - fieldEditor = editor; + if ( editor != fieldEditor ) + { + [editor retain]; + [fieldEditor release]; + fieldEditor = editor; + } } - (wxNSTextFieldEditor*) fieldEditor @@ -630,7 +635,7 @@ wxNSTextFieldControl::wxNSTextFieldControl(wxWindow *wxPeer, void wxNSTextFieldControl::Init(WXWidget w) { - NSTextField wxOSX_10_6_AND_LATER() *tf = (NSTextField*) w; + NSTextField wxOSX_10_6_AND_LATER() *tf = (NSTextField wxOSX_10_6_AND_LATER()*) w; m_textField = tf; [m_textField setDelegate: tf]; m_selStart = m_selEnd = 0;