SoftingIndustrial / OPC-Classic-SDK

Softing OPC Classic SDK
https://industrial.softing.com/de/produkte/opc-ua-und-opc-classic-sdks.html
MIT License
53 stars 22 forks source link

Error in SOCmnList.cpp #5

Open Eta76 opened 2 years ago

Eta76 commented 2 years ago

Line 720 of SOCmnList.cpp should proabably say: SOCMN_FREE_OBJECT_C(m_info, (**SOCmnListInfoMap***));

Haven't looked into the MACRO, but they could be all deleting the same pointer. Making line 719 and 720 not do anything

Source: OPC-Classic-SDK-main\development\core\src\SOCmn\SOCmnList.cpp BOOL SOCmnListHeader::create( IN OPTIONAL SOCmnListConfig creationConfig) { if (isInit()) { return FALSE; } if (isList()) { if ((m_type & SOCMNLIST_TYPE_INFO_FULL_LIST) != 0) { SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoFullList)); } else { SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoSimpleList)); } } else if (isMap()) { SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoMap)); } else { // something went wrong and the old type can not determined SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoFullList)); SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoSimpleList)); SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoSimpleList*)); <===== Line 720 }

FischerSeb commented 2 years ago

You are right. Can you please create a PR for this.

mkentie commented 2 years ago

I've created a pull request (I'm ETA76's coworker).

Eta76 commented 2 years ago

@FischerSeb So this macro is not meant to be used for the currently allocated type? I suspected that you possibly needed to call the correct macro, knowing that is m_info contains a map or list. (isMap(), isList())