title: GWT - EventBus calling event for object that no longer exists
body: <p>I ran into this problem in a large program, so I wrote a small sample to test it. I'm hoping someone can explain this to me.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>EventBus bus = new SimpleEventBus();
  
  class TestClass {
      TestClass() {
          bus.addHandler(TestEvent.TYPE, new TestHandler() {
  
              @Override
              public void onEvent(TestEvent event) {
                  System.out.println("test");
              }
  
          });
      }
  }
  
  class TestEvent extends GwtEvent&lt;TestHandler&gt; {
      public static final GwtEvent.Type&lt;TestHandler&gt; TYPE = new GwtEvent.Type&lt;TestHandler&gt;();
  
      @Override
      public Type&lt;TestHandler&gt; getAssociatedType() {
          return TYPE;
      }
  
      @Override
      protected void dispatch(TestHandler handler) {
          handler.onEvent(this);
      }
  }
  
  interface TestHandler extends EventHandler {
      void onEvent(TestEvent event);
  }
  </code></pre>
  
  <p>After which I do the following:</p>
  
  <pre><code>TestClass c1 = new TestClass();
  c1 = new TestClass();
  bus.fireEvent(new TestEvent());
  </code></pre>
  
  <p>Now by my logic, the output to this should be a single "test"; in fact, it is two "test"s, the handler is called twice. I don't really get why this is; c1 is a single object, so shouldn't the handler only be called once?</p>