X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=mISDN.cpp;h=ce885d9ca2b08884ffe2918d0e1a57975caf84c1;hp=c92e427aa7db2ce19056ae20490e79d56674277d;hb=b987a1bbbcabbf183ebe009903778671a1591337;hpb=323cbc387b1a068f8e2bcfd1034666406ba18c93 diff --git a/mISDN.cpp b/mISDN.cpp index c92e427..ce885d9 100644 --- a/mISDN.cpp +++ b/mISDN.cpp @@ -2378,13 +2378,15 @@ void mISDNport_close(struct mISDNport *mISDNport) int i; /* remove all port instance that are linked to this mISDNport */ + again: port = port_first; while(port) { if ((port->p_type&PORT_CLASS_MASK) == PORT_CLASS_mISDN) { isdnport = (class PmISDN *)port; - if (isdnport->p_m_mISDNport) { + if (isdnport->p_m_mISDNport && isdnport->p_m_mISDNport == mISDNport) { PDEBUG(DEBUG_ISDN, "port %s uses mISDNport %d, destroying it.\n", isdnport->p_name, mISDNport->portnum); delete isdnport; + goto again; } } port = port->next;