mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 10:35:25 +00:00
Fix crash in hexdump, issue #163
To prevent recursive calls to hexScrolled block the signals of the verticalScrollBars of the QTextEdit widgets.
This commit is contained in:
parent
44d1b0454f
commit
6ffb18e6e4
@ -750,9 +750,18 @@ void MemoryWidget::hexScrolled()
|
||||
|
||||
QList<QString> ret = this->get_hexdump(lastline);
|
||||
|
||||
this->hexOffsetText->append(ret[0]);
|
||||
this->hexHexText->append(ret[1]);
|
||||
this->hexASCIIText->append(ret[2]);
|
||||
// To prevent recursive calls to hexScrolled (this function) blocks the
|
||||
// scroll bar signals
|
||||
auto appendTextWithoutSignals = [](QTextEdit *edit, const QString &text)
|
||||
{
|
||||
edit->verticalScrollBar()->blockSignals(true);
|
||||
edit->append(text);
|
||||
edit->verticalScrollBar()->blockSignals(false);
|
||||
};
|
||||
|
||||
appendTextWithoutSignals(hexOffsetText, ret[0]);
|
||||
appendTextWithoutSignals(hexHexText, ret[1]);
|
||||
appendTextWithoutSignals(hexASCIIText, ret[2]);
|
||||
this->resizeHexdump();
|
||||
|
||||
// Append more hex text here
|
||||
|
Loading…
Reference in New Issue
Block a user