Minor Update:
- WatchdogCore: - Renamed FunctionType TYPE_WATCHDOG -> TYPE_WATCHDOGPING - ApplicationCore: - Prevent overwriting existing Function Type
This commit is contained in:
@@ -51,9 +51,9 @@ CApplication::CApplication( EDebugLevel pLogLevel )
|
||||
|
||||
// Add Core Function Types
|
||||
//AddFunctionType( TYPE_FUNCTION, NewFunctionCore ); // <-- Can't add virtual function
|
||||
AddFunctionType( TYPE_SELECTABLE, NewSelectableCore );
|
||||
AddFunctionType( TYPE_WATCHDOG, NewWatchdogCore );
|
||||
AddFunctionType( TYPE_FILE, NewFileCore );
|
||||
AddFunctionType( TYPE_SELECTABLE, NewSelectableCore );
|
||||
AddFunctionType( TYPE_WATCHDOGPING, NewWatchdogCore );
|
||||
AddFunctionType( TYPE_FILE, NewFileCore );
|
||||
//AddFunctionType( TYPE_DEVICE, NewDeviceCore ); // <-- Can't add virtual function
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
@@ -381,8 +381,13 @@ bool CApplication::AddFunctionType( const char * Type, FFuncConstructor Construc
|
||||
|
||||
// Get end of list
|
||||
FunctionType = &FirstFunctionType;
|
||||
while (*FunctionType)
|
||||
while (*FunctionType && strcasecmp(Type, (*FunctionType)->Name))
|
||||
FunctionType = &((*FunctionType)->Next);
|
||||
if (*FunctionType) {
|
||||
if (Log) Log->Message( dlLow, dlLow, "%s: Cannot add FunctionType '%s' - Already exists",
|
||||
ProcessName, Type );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Add new Type
|
||||
*FunctionType = (TFunctionType*)calloc( sizeof(TFunctionType), 1 );
|
||||
|
||||
Reference in New Issue
Block a user