From b5b986111b7318e43d9f09df3dd918a453d07c34 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sat, 21 Jul 2012 05:14:44 +0000 Subject: [PATCH] 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 --- src/osx/cocoa/textctrl.mm | 5 +++++ 1 file changed, 5 insertions(+) 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 { -- 2.45.2