title: Guava/Otto EventBus with null references
body: <p>Suppose the following scenario with classes A,B and an instance of a event bus (It can be the <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/eventbus/package-summary.html" rel="nofollow">Guava event bus</a>, by Google or the <a href="http://square.github.io/otto/" rel="nofollow">Otto event bus</a>, by Squ.re)</p>
  
  <pre><code>class A{
      @Subscribe
      public void onSomething(B event){
          //do something
      }
  }
  
  A a = new A();
  eventBus.subscribe(a);
  eventBus.post(new B());
  // onSomething is called, everything ok
  
  a = null;
  eventBus.post(new B());
  // onSomething is called again
  </code></pre>
  
  <p>Now, if I run that (only tested with Otto) <code>onSomething</code> is called 2 times. </p>
  
  <p>¿Will the event bus hold a reference to '<code>a</code>' until unregister is called?</p>
  
  <p>And more importantly</p>
  
  <p>¿If for some reason I am unable to determine the moment in which '<code>a</code>' will be null, then the event bus will hold a useless reference to the object forever (memory leak)?</p>