weimingtom / angel-engine

Automatically exported from code.google.com/p/angel-engine
0 stars 0 forks source link

Destroyed actors should unsubscribe from all messages #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I was getting a weird problem where actors that had been marked for Destroy
() were still getting messages (which would work perfectly fine until that 
memory gets stomped).

While you can add the unsubscribes in the PreDestroy(), seems friendlier 
to just take care of that automatically.

Original issue reported on code.google.com by BorutPfe...@gmail.com on 24 Apr 2009 at 1:29

GoogleCodeExporter commented 8 years ago
We should make this part of the MessageListener destructor -- for some reason I
thought it already was. Wonder where this got lost. Hmm. 

Original comment by lieseg...@gmail.com on 24 Apr 2009 at 1:53

GoogleCodeExporter commented 8 years ago
Wait, doesn't this happen in the Actor destructor? Take a look. 

Original comment by lieseg...@gmail.com on 24 Apr 2009 at 2:27

GoogleCodeExporter commented 8 years ago
It does, I now realize. Part of my problem was assuming calling Destroy would 
delete 
the actor, which it doesn't apparently (I believe that's commented out b/c it 
was 
causing other problems?). So that's another issue (or just my ignorance).

But yeah, it should probably be part of the message listener destructor 
instead, 
even so, right?

Original comment by BorutPfe...@gmail.com on 24 Apr 2009 at 4:20

GoogleCodeExporter commented 8 years ago
Moved to MessageListener destructor in reorg branch. 

Original comment by lieseg...@gmail.com on 3 Jul 2010 at 1:12