summaryrefslogtreecommitdiffstats
path: root/pica-client/skynet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client/skynet.cpp')
-rw-r--r--pica-client/skynet.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/pica-client/skynet.cpp b/pica-client/skynet.cpp
index da9f558..02be732 100644
--- a/pica-client/skynet.cpp
+++ b/pica-client/skynet.cpp
@@ -85,7 +85,7 @@ void SkyNet::nodelink_activated(PICA_c2n *c2n)
if (self_aware)
{
- PICA_close_c2n(c2n);
+ connected_nodes_to_close.append(c2n);
}
else
{
@@ -284,6 +284,11 @@ void SkyNet::timerEvent(QTimerEvent *e)
ret = PICA_event_loop(nodelinks.data(), 1);
+ while(!connected_nodes_to_close.empty())
+ {
+ PICA_close_c2n(connected_nodes_to_close.takeFirst());
+ }
+
if (ret != PICA_OK)
emit StatusMsg("event loop error!", true);//show some error message
}