Merge pull request #7482 from Robyt3/Client-Serverbrowser-CommunityIcon-Leak

Fix leak of community icons when jobs not finished
This commit is contained in:
heinrich5991 2023-11-16 21:06:00 +00:00 committed by GitHub
commit 4116d78c6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -520,6 +520,7 @@ protected:
SHA256_DIGEST m_Sha256;
CAbstractCommunityIconJob(CMenus *pMenus, const char *pCommunityId, int StorageType);
virtual ~CAbstractCommunityIconJob();
public:
const char *CommunityId() const { return m_aCommunityId; }

View file

@ -1799,6 +1799,12 @@ CMenus::CAbstractCommunityIconJob::CAbstractCommunityIconJob(CMenus *pMenus, con
str_format(m_aPath, sizeof(m_aPath), "communityicons/%s.png", pCommunityId);
}
CMenus::CAbstractCommunityIconJob::~CAbstractCommunityIconJob()
{
free(m_ImageInfo.m_pData);
m_ImageInfo.m_pData = nullptr;
}
int CMenus::CCommunityIconDownloadJob::OnCompletion(int State)
{
State = CHttpRequest::OnCompletion(State);