Added guard for some object inits to prevent memory leak by misuse (#662)
Co-authored-by: Nik Schewtschuk <nikonlinee@gmail.com>
This commit is contained in:
@@ -1279,5 +1279,7 @@ void Analog_Output_Cleanup(void)
|
||||
*/
|
||||
void Analog_Output_Init(void)
|
||||
{
|
||||
Object_List = Keylist_Create();
|
||||
if (!Object_List) {
|
||||
Object_List = Keylist_Create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1554,5 +1554,7 @@ void Binary_Lighting_Output_Cleanup(void)
|
||||
*/
|
||||
void Binary_Lighting_Output_Init(void)
|
||||
{
|
||||
Object_List = Keylist_Create();
|
||||
if (!Object_List) {
|
||||
Object_List = Keylist_Create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1231,5 +1231,7 @@ bool Binary_Output_Delete(uint32_t object_instance)
|
||||
*/
|
||||
void Binary_Output_Init(void)
|
||||
{
|
||||
Object_List = Keylist_Create();
|
||||
if (!Object_List) {
|
||||
Object_List = Keylist_Create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,5 +1006,7 @@ bool Binary_Value_Delete(uint32_t object_instance)
|
||||
*/
|
||||
void Binary_Value_Init(void)
|
||||
{
|
||||
Object_List = Keylist_Create();
|
||||
if (!Object_List) {
|
||||
Object_List = Keylist_Create();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user