From 7673703b4bf608188a7027524dd7130e3f044d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D0=B5=D0=BB=D0=B8=D0=BF=D0=B5=D0=BD=D0=BA=D0=BE=20?= =?UTF-8?q?=D0=98=D0=B2=D0=B0=D0=BD?= Date: Mon, 20 Apr 2015 12:02:02 +0000 Subject: [PATCH] PIPeer important fix! git-svn-id: svn://db.shs.com.ru/pip@116 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5 --- src/io/pipeer.cpp | 9 +++++++++ src/thread/pitimer.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/io/pipeer.cpp b/src/io/pipeer.cpp index 6ef8ecea..7942d857 100755 --- a/src/io/pipeer.cpp +++ b/src/io/pipeer.cpp @@ -149,6 +149,13 @@ PIPeer::PIPeer(const PIString & name_): PIObject() { PIPeer::~PIPeer() { destroyed = true; + PIMutexLocker ml(peers_mutex); + piForeach (PeerInfo & p, peers) + if (p._data) { + p._data->dt_in.stop(); + p._data->dt_out.stop(); + p._data->t.stop(true); + } timer.stop(); diag_s.stop(); diag_d.stop(); @@ -161,6 +168,8 @@ PIPeer::~PIPeer() { sendSelfRemove(); destroyMBcasts(); eth_send.close(); + piForeach (PeerInfo & p, peers) + p.destroy(); } diff --git a/src/thread/pitimer.cpp b/src/thread/pitimer.cpp index 2069c04c..d9b755a7 100755 --- a/src/thread/pitimer.cpp +++ b/src/thread/pitimer.cpp @@ -333,7 +333,7 @@ void _PITimerImp_Pool::Pool::add(_PITimerImp_Pool * t) { void _PITimerImp_Pool::Pool::remove(_PITimerImp_Pool * t) { //piCout << "remove ..."; lock(); - to_remove.removeOne(t); + to_remove << t; unlock(); //piCout << "remove done"; }