<div dir="ltr">If you need just to remove gen_event handler, use gen_event:add_sup_handler, and handler will be removed automatically when your process dies.</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/20 Seven Du <span dir="ltr"><<a href="mailto:dujinfang@gmail.com" target="_blank">dujinfang@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                <div>
                    Hi,
                </div><div><br></div><div>I'd like to know is it possible to have a terminate callback that clean up things when the supervisor stops?</div><div><br></div><div>Specifically I want to write an application which starts a supervisor, and add a handler to some existing gen_event by calling gen_event:add_handler() on init(), and I want to call gen_event:remove_handler() when the application is stop. Is there an easy way to do it?</div>

<div><br></div><div>Thanks </div><span class="HOEnZb"><font color="#888888">
                <div><div><br></div><div>-- </div><div>Seven Du</div><div><span style="font-size:10pt"><a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a></span></div><div><a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a></div>

<div><div><a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a></div></div><div><br></div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig" target="_blank">Sparrow</a></div><div><br></div>

</div>
            </font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><font face="'courier new', monospace">---------------------------------------------</font><div><font face="'courier new', monospace">Данил Загоскин | +7 906 064 20 47 | <a href="mailto:z@gosk.in" target="_blank">z@gosk.in</a></font></div>


</div>