- moved protocol removal to a proper function

This commit is contained in:
cebix 1999-10-03 21:04:18 +00:00
parent 77a1805504
commit f087a2d3bc

View File

@ -89,6 +89,18 @@ static NetProtocol *find_protocol(uint16 type)
}
/*
* Remove all protocols
*/
static void remove_all_protocols(void)
{
NetProtocol *p;
while ((p = (NetProtocol *)prot_list.RemoveItem((long)0)) != NULL)
delete p;
}
/*
* Initialization
*/
@ -248,9 +260,7 @@ void EtherExit(void)
delete_area(buffer_area);
// Remove all protocols
NetProtocol *p;
while ((p = (NetProtocol *)prot_list.RemoveItem((long)0)) != NULL)
delete p;
remove_all_protocols();
}
}
@ -261,10 +271,7 @@ void EtherExit(void)
void EtherReset(void)
{
// Remove all protocols
NetProtocol *p;
while ((p = (NetProtocol *)prot_list.RemoveItem((long)0)) != NULL)
delete p;
remove_all_protocols();
}