yuntaozhu / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

PubSub publish function missing error handling #484

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Subscribe on a PubSub topic with a function that throws an error
2. publish that topic

What is the expected output? What do you see instead?

PubSub.publish() should recover from the error.  It does not, and a side effect 
is that this.publishDepth_ is never decremented, which in turn means that no 
unsubscribe calls are ever processed, leading to memory leaks or subsequent 
errors.

At the very least, this statement needs to be in a finally block:
this.publishDepth_--;

Original issue reported on code.google.com by fay.s...@gmail.com on 20 Jul 2012 at 2:31