1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

unlink detection rewrite - please test this

This commit is contained in:
psyc://psyced.org/~lynX 2011-01-19 22:19:34 +01:00
parent 6b8e138eb4
commit b4867481f4
7 changed files with 70 additions and 36 deletions

View file

@ -15,7 +15,7 @@ inherit NET_PATH "spyc/circuit";
// keep a list of objects to ->disconnected() when the driver tells us
volatile array(object) disconnect_notifies;
void do_notify_on_disconnect(object user) {
void register_link(object user) {
unless(disconnect_notifies)
disconnect_notifies = ({ });
disconnect_notifies += ({ user });
@ -54,7 +54,7 @@ disconnected(remaining) {
// emulate disconnect() for net/psyc/user
if (disconnect_notifies) {
foreach (object t : disconnect_notifies)
if (t) t->disconnected();
if (t) t->link_disconnected();
}
rc = ::disconnected(remaining);
destruct(ME);