…during text selection by only setting plaintext mime data.
Fixes the OOM described in #887.
The issue is related to the construction of the text/markdown
MIME data for the selection. Using the heaptrack
utility, I observed that nearly all of the allocations when reproducing happen in QTextMarkdownWriter::writeFrame
. I am not 100% sure what is causing this issue in QT’s conversion of our HTML to markdown; I have tried changing the HTML tags (e.g. using <p></p
> and <ul><li></li></ul>
in place of tables) used in our rpcconsole
messages, but the issue recurs.
The solution applied here is to override createMimeDataFromSelection()
to avoid construction of the (likely never-used anyways) text/markdown
mime data, and only set plaintext mime data in the clipboard.