[vte] widget: Throw away remaining incoming data on finalize
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte] widget: Throw away remaining incoming data on finalize
- Date: Wed, 1 May 2019 14:34:42 +0000 (UTC)
commit fc0b0c456b93c97d3a0b2676780c72c7018eaf94
Author: Christian Persch <chpe src gnome org>
Date: Wed May 1 16:33:07 2019 +0200
widget: Throw away remaining incoming data on finalize
There is no need to process remaining incoming data when
we're just finalizeing the widget.
https://gitlab.gnome.org/GNOME/vte/issues/122
src/vte.cc | 7 ++++---
src/vteinternal.hh | 3 ++-
2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/vte.cc b/src/vte.cc
index 0aa9a3fc..55cab374 100644
--- a/src/vte.cc
+++ b/src/vte.cc
@@ -8084,7 +8084,7 @@ Terminal::~Terminal()
guint i;
terminate_child();
- set_pty(nullptr);
+ set_pty(nullptr, false /* don't process remaining data */);
remove_update_timeout(this);
/* Stop processing input. */
@@ -9977,7 +9977,8 @@ Terminal::reset(bool clear_tabstops,
}
bool
-Terminal::set_pty(VtePty *new_pty)
+Terminal::set_pty(VtePty *new_pty,
+ bool process_remaining)
{
if (new_pty == m_pty)
return false;
@@ -9994,7 +9995,7 @@ Terminal::set_pty(VtePty *new_pty)
/* Take one last shot at processing whatever data is pending,
* then flush the buffers in case we're about to run a new
* command, disconnecting the timeout. */
- if (!m_incoming_queue.empty()) {
+ if (!m_incoming_queue.empty() && process_remaining) {
process_incoming();
while (!m_incoming_queue.empty())
m_incoming_queue.pop();
diff --git a/src/vteinternal.hh b/src/vteinternal.hh
index 58cb0479..9010b9b0 100644
--- a/src/vteinternal.hh
+++ b/src/vteinternal.hh
@@ -1140,7 +1140,8 @@ public:
bool set_font_scale(double scale);
bool set_input_enabled(bool enabled);
bool set_mouse_autohide(bool autohide);
- bool set_pty(VtePty *pty);
+ bool set_pty(VtePty *pty,
+ bool proces_remaining = true);
bool set_rewrap_on_resize(bool rewrap);
bool set_scrollback_lines(long lines);
bool set_scroll_on_keystroke(bool scroll);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]