Clear warning on SelectCore:
- use new instead of malloc/memset to init struct
This commit is contained in:
@@ -54,7 +54,7 @@ CSelect::~CSelect()
|
||||
while (FirstHandle)
|
||||
{
|
||||
NextHandle = FirstHandle->Next;
|
||||
free( FirstHandle );
|
||||
delete FirstHandle;
|
||||
FirstHandle = NextHandle;
|
||||
}
|
||||
|
||||
@@ -95,8 +95,7 @@ void CSelect::Add( int FD, bool Read, bool Write, THandle * Handle, CSelectableB
|
||||
}
|
||||
if (!*SelectHandle) {
|
||||
// Create if not exist
|
||||
*SelectHandle = (TSelectHandle*)malloc( sizeof(TSelectHandle) );
|
||||
memset( *SelectHandle, 0, sizeof(TSelectHandle) );
|
||||
*SelectHandle = new TSelectHandle;
|
||||
|
||||
// Set Parameters
|
||||
(*SelectHandle)->FD = FD;
|
||||
@@ -229,7 +228,7 @@ bool CSelect::Test()
|
||||
*HandlePtr = (*HandlePtr)->Next;
|
||||
|
||||
// Destroy and go to next
|
||||
free( Handle );
|
||||
delete Handle;
|
||||
Handle = *HandlePtr;
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user