{"action":"opened","issue":{"url":"https://api.github.com/repos/bboyfeiyu/AndroidEventBus/issues/31","labels_url":"https://api.github.com/repos/bboyfeiyu/AndroidEventBus/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/bboyfeiyu/AndroidEventBus/issues/31/comments","events_url":"https://api.github.com/repos/bboyfeiyu/AndroidEventBus/issues/31/events","html_url":"https://github.com/bboyfeiyu/AndroidEventBus/issues/31","id":120925677,"number":31,"title":"弱引用带来的事件不触发问题","user":{"login":"YULIANGMAX","id":1726621,"avatar_url":"https://avatars.githubusercontent.com/u/1726621?v=3","gravatar_id":"","url":"https://api.github.com/users/YULIANGMAX","html_url":"https://github.com/YULIANGMAX","followers_url":"https://api.github.com/users/YULIANGMAX/followers","following_url":"https://api.github.com/users/YULIANGMAX/following{/other_user}","gists_url":"https://api.github.com/users/YULIANGMAX/gists{/gist_id}","starred_url":"https://api.github.com/users/YULIANGMAX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YULIANGMAX/subscriptions","organizations_url":"https://api.github.com/users/YULIANGMAX/orgs","repos_url":"https://api.github.com/users/YULIANGMAX/repos","events_url":"https://api.github.com/users/YULIANGMAX/events{/privacy}","received_events_url":"https://api.github.com/users/YULIANGMAX/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-08T04:05:27Z","updated_at":"2015-12-08T04:05:27Z","closed_at":null,"body":"1.0.2版正常，在1.0.4版本以上时发现某些订阅方法无法接收到事件。\r\n使用场景简述如下：\r\n抽象类Alistener，包含订阅事件的方法method1，tag = “TAG1”，Alistener的实现类AAAlistener。\r\n抽象类Blistener，包含订阅事件的方法method2，tag = “TAG2”，Blistener的实现类BBBlistener。\r\n首先EventBus注册AAAlistener，当用户在UI触发事件“TAG1”，在AAAlistener的method1方法收到事件，在method1方法中EventBus注册new BBBlistener，接着弹出对话框让用户操作，完成之后发送“TAG2”事件；正常情况应该是BBBlistener的method2接收到这个事件，实际却没有接收到。\r\n\r\n下载源码跟踪调试后发现在DefaultEventHandler的handleEvent方法调用时，应该执行BBBlistener.method2的时候，subscription.subscriber.get()却为null。目前并未深入研究，猜测是不是因为弱引用的AAAlistener被回收导致在其方法内new的BBBlistener也被回收？"}}