[vte] Handle out-of-history remove's gracefully



commit a91d1adf8cbc3bf9755d1c211f490366ac47782c
Author: Behdad Esfahbod <behdad behdad org>
Date:   Mon Oct 26 19:54:28 2009 -0400

    Handle out-of-history remove's gracefully
    
    They happen at times of resizing the terminal, etc.
    
    Bug 597604 - gnome-terminal assert failure:
    Vte:ERROR:/build/buildd/vte-0.22.0/./src/ring.c:530:_vte_ring_remove:
    assertion failed: (_vte_ring_contains (ring, position))

 src/ring.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/ring.c b/src/ring.c
index 84cd6a9..54a9682 100644
--- a/src/ring.c
+++ b/src/ring.c
@@ -533,7 +533,8 @@ _vte_ring_remove (VteRing * ring, gulong position)
 	_vte_debug_print(VTE_DEBUG_RING, "Removing item at position %lu.\n", position);
 	_vte_ring_validate(ring);
 
-	g_assert (_vte_ring_contains (ring, position));
+	if (G_UNLIKELY (!_vte_ring_contains (ring, position)))
+		return;
 
 	_vte_ring_ensure_writable (ring, position);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]