From d5c20d85d0642dcb6e5f3341cc5a7d0e8e48afbb Mon Sep 17 00:00:00 2001 From: Fritz Elfert Date: Fri, 27 Jul 2001 20:49:49 +0000 Subject: Fixed crash when deleting socketChan. --- ncpd/ncp.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'ncpd') diff --git a/ncpd/ncp.cc b/ncpd/ncp.cc index 891fc9f..b72a708 100644 --- a/ncpd/ncp.cc +++ b/ncpd/ncp.cc @@ -54,7 +54,7 @@ ncp::ncp(const char *fname, int baud, IOWatch & iow) protocolVersion = PV_SERIES_5; // init channels - for (int i = 0; i < maxLinks(); i++) + for (int i = 0; i < MAX_CHANNELS_PSION; i++) channelPtr[i] = NULL; } @@ -67,13 +67,11 @@ ncp::~ncp() b2.addByte(remoteChanList[i]); controlChannel(i, NCON_MSG_CHANNEL_DISCONNECT, b2); } - delete channelPtr[i]; channelPtr[i] = NULL; } controlChannel(0, NCON_MSG_NCP_END, b); delete l; delete channelPtr; - delete messageList; delete remoteChanList; } @@ -87,7 +85,6 @@ reset() { for (int i = 0; i < maxLinks(); i++) { if (channelPtr[i]) channelPtr[i]->terminateWhenAsked(); - delete channelPtr[i]; channelPtr[i] = NULL; } failed = false; @@ -423,7 +420,6 @@ disconnect(int channel) channelPtr[channel]->terminateWhenAsked(); if (verbose & NCP_DEBUG_LOG) cout << "ncp: disconnect: channel=" << channel << endl; - delete channelPtr[channel]; channelPtr[channel] = NULL; bufferStore b; b.addByte(remoteChanList[channel]); -- cgit v1.2.3