Commit 9496b4e3 authored by Matan Ziv-Av's avatar Matan Ziv-Av Committed by Tomaz Canabrava
Browse files

Reuse ubidi object for all bidi calls

Rather than allocating (and leaking) a new ubidi structure on every call
to bidiMap().
parent 24cc94d5
......@@ -78,12 +78,6 @@
#include "TerminalPainter.h"
#include "TerminalScrollBar.h"
#include "unicode/localpointer.h"
#include "unicode/ubidi.h"
#include "unicode/uchar.h"
#include "unicode/ushape.h"
#include "unicode/utypes.h"
using namespace Konsole;
inline int TerminalDisplay::loc(int x, int y) const
......@@ -309,6 +303,7 @@ TerminalDisplay::TerminalDisplay(QWidget *parent)
};
_printManager.reset(new KonsolePrintManager(ldrawBackground, ldrawContents, lgetBackgroundColor));
ubidi = ubidi_open();
}
TerminalDisplay::~TerminalDisplay()
......@@ -318,6 +313,8 @@ TerminalDisplay::~TerminalDisplay()
delete[] _image;
delete _filterChain;
ubidi_close(ubidi);
}
void TerminalDisplay::setupHeaderVisibility()
......@@ -2990,7 +2987,6 @@ int TerminalDisplay::bidiMap(Character *screenline,
if (!bidi) {
return lastNonSpace;
}
UBiDi *ubidi = ubidi_open();
UBiDiLevel paraLevel = _bidiLineLTR ? 0 : UBIDI_DEFAULT_LTR;
if (_bidiTableDirOverride) {
ubidi_setClassCallback(ubidi, BiDiClass, nullptr, nullptr, nullptr, &errorCode);
......
......@@ -26,6 +26,12 @@
#include "TerminalBell.h"
#include "unicode/localpointer.h"
#include "unicode/ubidi.h"
#include "unicode/uchar.h"
#include "unicode/ushape.h"
#include "unicode/utypes.h"
class QDrag;
class QDragEnterEvent;
class QDropEvent;
......@@ -787,6 +793,8 @@ private:
bool _semanticUpDown;
bool _semanticInputClick;
UBiDi *ubidi = nullptr;
};
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment