             head = tail = state;
         }
     }
+
+    // break the entire linked list as flash's gc isn't the
+    // most reliable with connected but unreachable objects
+    public function clear():void
+    {
+        var node:TextBlockState = head;
+        var next:TextBlockState;
+
+        while (node)
+        {
+            next = node.next;
+            node.next = null;
+            node.prev = null;
+            node = next;
+        }
+    }
 }
 
 internal class BlockStateIndex
 {
     private var byBlock:Dictionary;
     private var byID:Object;
-    private var nextid:uint = 0;
+    private var nextid:uint;
 
     public function BlockStateIndex()
+    {
+        clear();
+    }
+
+    public function clear():void
     {
         byBlock = new Dictionary();
         byID = { };
+        nextid = 0;
     }
 
     public function add(newState:TextBlockState):void

    private function onBlockChange(event:Event):void
    {
        invalidateBlock(store.getByBlock(TextBlock(event.target)));
        compose();
    }

    private function createState(block:TextBlock):TextBlockState

package org.yellcorp.debug.console.richtext
{
import org.yellcorp.text.TextEventUtil;

import flash.events.Event;
import flash.events.TextEvent;
