Jump to content

DB Warning (ClientManager.cpp)


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
Share on other sites

  • 4 months later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.