From: Stefan Csomor Date: Sat, 21 Jul 2012 05:14:44 +0000 (+0000) Subject: turning off undo for setter, otherwise memory gets used up for the undo stack, fixes... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b5b986111b7318e43d9f09df3dd918a453d07c34 turning off undo for setter, otherwise memory gets used up for the undo stack, fixes #14500 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/cocoa/textctrl.mm b/src/osx/cocoa/textctrl.mm index 2daf86fb94..b1364c509c 100644 --- a/src/osx/cocoa/textctrl.mm +++ b/src/osx/cocoa/textctrl.mm @@ -867,7 +867,12 @@ void wxNSTextFieldControl::WriteText(const wxString& str) if ( editor ) { wxMacEditHelper helper(m_textField); + BOOL hasUndo = [editor respondsToSelector:@selector(setAllowsUndo:)]; + if ( hasUndo ) + [editor setAllowsUndo:NO]; [editor insertText:wxCFStringRef( str , m_wxPeer->GetFont().GetEncoding() ).AsNSString()]; + if ( hasUndo ) + [editor setAllowsUndo:YES]; } else {