Fixed: cURL multi/easy handle cleanup

--HG--
branch : develop
This commit is contained in:
Nimetu 2018-03-13 20:41:46 +02:00
parent f5928305fe
commit ccb2cbfa78

View file

@ -698,6 +698,8 @@ namespace NLGUI
} }
requestTerminated(); requestTerminated();
} }
continue;
} }
for (vector<CDataDownload>::iterator it=Curls.begin(); it<Curls.end(); it++) for (vector<CDataDownload>::iterator it=Curls.begin(); it<Curls.end(); it++)
@ -871,8 +873,20 @@ namespace NLGUI
#ifdef LOG_DL #ifdef LOG_DL
nlwarning("Release Downloads"); nlwarning("Release Downloads");
#endif #endif
if(MultiCurl)
curl_multi_cleanup(MultiCurl); // remove all queued and already started downloads
for (uint i = 0; i < Curls.size(); ++i)
{
if (Curls[i].data)
{
if (MultiCurl)
curl_multi_remove_handle(MultiCurl, Curls[i].data->Request);
// release CCurlWWWData
delete Curls[i].data;
}
}
Curls.clear();
} }
class CGroupListAdaptor : public CInterfaceGroup class CGroupListAdaptor : public CInterfaceGroup
@ -3059,8 +3073,13 @@ namespace NLGUI
// this is why the call to 'updateRefreshButton' has been removed from stopBrowse // this is why the call to 'updateRefreshButton' has been removed from stopBrowse
clearContext(); clearContext();
releaseDownloads();
if (_CurlWWW) if (_CurlWWW)
delete _CurlWWW; delete _CurlWWW;
if(MultiCurl)
curl_multi_cleanup(MultiCurl);
} }
std::string CGroupHTML::getProperty( const std::string &name ) const std::string CGroupHTML::getProperty( const std::string &name ) const