mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Avoided listener callbacks during TextEditor destructor.
This commit is contained in:
parent
48d9050f02
commit
fc683ee72a
1 changed files with 8 additions and 3 deletions
|
|
@ -966,7 +966,12 @@ TextEditor::~TextEditor()
|
|||
|
||||
textValue.removeListener (textHolder);
|
||||
textValue.referTo (Value());
|
||||
clearInternal (0);
|
||||
|
||||
for (int i = 0; i < sections.size(); ++i)
|
||||
delete sections.getUnchecked(i);
|
||||
|
||||
sections.clear();
|
||||
|
||||
viewport = nullptr;
|
||||
textHolder = nullptr;
|
||||
}
|
||||
|
|
@ -1183,7 +1188,7 @@ void TextEditor::setScrollBarThickness (const int newThicknessPixels)
|
|||
//==============================================================================
|
||||
void TextEditor::clear()
|
||||
{
|
||||
clearInternal (0);
|
||||
clearInternal (nullptr);
|
||||
updateTextHolderSize();
|
||||
undoManager.clearUndoHistory();
|
||||
}
|
||||
|
|
@ -1200,7 +1205,7 @@ void TextEditor::setText (const String& newText,
|
|||
int oldCursorPos = caretPosition;
|
||||
const bool cursorWasAtEnd = oldCursorPos >= getTotalNumChars();
|
||||
|
||||
clearInternal (0);
|
||||
clearInternal (nullptr);
|
||||
insert (newText, 0, currentFont, findColour (textColourId), 0, caretPosition);
|
||||
|
||||
// if you're adding text with line-feeds to a single-line text editor, it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue