Metin2Learning 1 Posted February 8, 2021 Share Posted February 8, 2021 (edited) Hello everyone! I start solve all warnings in my sources and the last one would be this : ClientManager.cpp: In member function 'void CClientManager::MainLoop()': ClientManager.cpp:353:10: warning: deleting object of polymorphic class type 'CItemPriceListTableCache' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor] delete pCache; My code looks like this : for (itertype(m_mapItemPriceListCache) itPriceList = m_mapItemPriceListCache.begin(); itPriceList != m_mapItemPriceListCache.end(); ++itPriceList) { CItemPriceListTableCache* pCache = itPriceList->second; pCache->Flush(); delete pCache; } I already try change like this : for (TItemPriceListCacheMap::const_iterator itPriceList = m_mapItemPriceListCache.begin(); itPriceList != m_mapItemPriceListCache.end(); ++itPriceList) { CItemPriceListTableCache* pCache = itPriceList->second; pCache->Flush(); delete pCache; } But not solve the problem. Maybe anybody have idea what could be the problem? Screen : Best wishes : ED. Spoiler Edited September 4, 2022 by Metin2 Dev Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Metin2 Kai 0 Posted June 26, 2021 Share Posted June 26, 2021 UP Link to comment Share on other sites More sharing options...
Active Member Volvox 1511 Posted June 28, 2021 Active Member Share Posted June 28, 2021 If you want to understand the warning: https://stackoverflow.com/questions/8764353/what-does-has-virtual-method-but-non-virtual-destructor-warning-mean-durin If you wanna just fix this create a destructor in CItemPriceListTableCache. 2 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now