Resolve fix:

- CancelResolv(): Standard function to cancel name resolve requests
  - Allow Resolv request to complete if not cancelled
  - Clear memory if resolve request cancelled
- getaddrinfo_a(): still leaks if thread not closed
Other:
- Code clean up
This commit is contained in:
2022-07-21 12:08:22 +02:00
parent 1c81055eea
commit fd3738567a
6 changed files with 85 additions and 90 deletions

View File

@@ -65,8 +65,7 @@ CApplication::~CApplication()
TFunctionType * NextType;
// Destroy functions
while (FirstFunction)
{
while (FirstFunction) {
NextFunction = FirstFunction->Next;
delete( FirstFunction->Function );
free( FirstFunction );
@@ -74,8 +73,7 @@ CApplication::~CApplication()
}
// Destroy function types
while (FirstFunctionType)
{
while (FirstFunctionType) {
NextType = FirstFunctionType->Next;
free( FirstFunctionType->Name );
free( FirstFunctionType );
@@ -116,8 +114,7 @@ void CApplication::GetProcessName( char ** ProcessName, char * pFilePath )
bool CApplication::ReadParam( int argc, char *argv[] )
{
// Read Parameters
if ((argc != 2))
{
if ((argc != 2)) {
// Get Process Name
GetProcessName( &ProcessName, argv[0] );
@@ -126,8 +123,7 @@ bool CApplication::ReadParam( int argc, char *argv[] )
printf( " usage: %s [ConfigFile]\n\n", ProcessName );
return false;
}
else
{
else {
// Load parameters
GetProcessName( &ProcessName, argv[1] );
ConfigFile = argv[1];