From f087a2d3bc9859a34e666a45aaed89712accc94e Mon Sep 17 00:00:00 2001 From: cebix <> Date: Sun, 3 Oct 1999 21:04:18 +0000 Subject: [PATCH] - moved protocol removal to a proper function --- BasiliskII/src/BeOS/ether_beos.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/BasiliskII/src/BeOS/ether_beos.cpp b/BasiliskII/src/BeOS/ether_beos.cpp index be98c096..33706b70 100644 --- a/BasiliskII/src/BeOS/ether_beos.cpp +++ b/BasiliskII/src/BeOS/ether_beos.cpp @@ -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(); }