Sander Bouwhuis - 2024-07-22

THE TOPIC SHOULD HAVE BEEN CALLED:
"How does shadowFunction work for member functions?"

I get this error:
Id: shadowFunction
CWE: 398
Shadow variable

The error is at the line where I close the TCP port during clean up by calling the member function Tcp_MonitorPort():

// The destructor
CWndHomeScreen::~CWndHomeScreen()
{
  ENTER_FUNCTION_DEBUG_LOG_TO_MEM

  try
  {
    CHECK_MEM_LEAKS

    // Free the resources
    Tcp_MonitorPort(false, false);
    PostMessage_Show(m_tabInfo.hWndLauncher, WMU_FINGERPRINT_REMOVE_CLIENT, NULL, LPARAM(m_hWnd));
    WaitForSingleObject(m_hInitMembersThread, 5000);
    SAFE_CLOSE_HANDLE(m_hInitMembersThread);
    SAFE_CLOSE_HANDLE(m_hSubModuleThreadHandle);
    SAFE_DELETE_OBJECT(m_hFontTile);
  }
  catch(...) { OnException(m_pWstrDebugLog, __FILE__, __LINE__, __FUNCSIG__, __TIMESTAMP__, nullptr); }
}

I don't understand what a 'shadow function' is. What am I doing wrong here?

 

Last edit: Sander Bouwhuis 2024-07-22