Jump to content

Recommended Posts

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 by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/25699-db-warning-clientmanagercpp/
Share on other sites

  • 4 months later...

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.

  • Metin2 Dev 2
  • Love 1

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.