From 04f7e9d36bf5003eb70a96b0529792c1878e12af Mon Sep 17 00:00:00 2001 From: paulc Date: Thu, 25 Aug 2011 10:02:56 +0000 Subject: [PATCH] Destruction of SS7 User Parts detaches from network/router in the base class. Fixes crash when removing a Test Part at runtime. git-svn-id: http://voip.null.ro/svn/yate@4569 acf43c95-373e-0410-b603-e72c3f656dc1 --- libs/ysig/isup.cpp | 1 - libs/ysig/layer4.cpp | 6 ++++++ libs/ysig/yatesig.h | 8 +++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/libs/ysig/isup.cpp b/libs/ysig/isup.cpp index 2269f8dd..831929f2 100644 --- a/libs/ysig/isup.cpp +++ b/libs/ysig/isup.cpp @@ -3613,7 +3613,6 @@ void SS7ISUP::destroyed() clearCalls(); unlock(); SignallingCallControl::attach(0); - SS7Layer4::attach(0); SS7Layer4::destroyed(); } diff --git a/libs/ysig/layer4.cpp b/libs/ysig/layer4.cpp index 234006e4..03791f29 100644 --- a/libs/ysig/layer4.cpp +++ b/libs/ysig/layer4.cpp @@ -37,6 +37,12 @@ SS7Layer4::SS7Layer4(unsigned char sio, const NamedList* params) m_sio = getSIO(*params,sio); } +void SS7Layer4::destroyed() +{ + attach(0); + SignallingComponent::destroyed(); +} + unsigned char SS7Layer4::getSIO(const NamedList& params, unsigned char sif, unsigned char prio, unsigned char ni) { if ((prio & 0x30) == 0) diff --git a/libs/ysig/yatesig.h b/libs/ysig/yatesig.h index 04f866bb..51ec29bc 100644 --- a/libs/ysig/yatesig.h +++ b/libs/ysig/yatesig.h @@ -703,7 +703,7 @@ protected: * This method is called to clean up and destroy the object after the * reference counter becomes zero */ - void destroyed(); + virtual void destroyed(); /** * Insert another component in the same engine as this one. @@ -6008,6 +6008,12 @@ private: class YSIG_API SS7Layer4 : public SS7L3User { public: + /** + * This method is called to clean up and destroy the object after the + * reference counter becomes zero + */ + virtual void destroyed(); + /** * Initialize the application layer, connect it to the SS7 router * @param config Optional configuration parameters override