本文整理汇总了C++中Memory::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ Memory::Clear方法的具体用法?C++ Memory::Clear怎么用?C++ Memory::Clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memory
的用法示例。
在下文中一共展示了Memory::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_http_page_threaded
void* get_http_page_threaded( ALLEGRO_THREAD* thread, void* ThreadData )
{
DOWNLOAD_THREAD_DATA* threadData = (DOWNLOAD_THREAD_DATA*)ThreadData;
CURL* curl_handle;
Memory* buffer = new Memory( 0 );
int cTO = 60;
curl_handle = curl_easy_init();
curl_easy_setopt( curl_handle, CURLOPT_URL, threadData->URL->c_str() );
curl_easy_setopt( curl_handle, CURLOPT_FOLLOWLOCATION, 1L );
curl_easy_setopt( curl_handle, CURLOPT_NOPROGRESS, 0L );
curl_easy_setopt( curl_handle, CURLOPT_WRITEFUNCTION, write_data );
curl_easy_setopt( curl_handle, CURLOPT_WRITEDATA, (void*)buffer );
curl_easy_setopt( curl_handle, CURLOPT_PROGRESSFUNCTION, download_progress );
curl_easy_setopt( curl_handle, CURLOPT_PROGRESSDATA, threadData->Information );
cTO = FRAMEWORK->Settings->GetQuickIntegerValue( "Downloads.TimeOut", 60 ); // Default timeout is 60, but get settings
curl_easy_setopt( curl_handle, CURLOPT_TIMEOUT, (long)cTO );
curl_easy_setopt( curl_handle, CURLOPT_NOSIGNAL, 1L );
if( FRAMEWORK->Settings->GetQuickBooleanValue( "Downloads.ProxyRequired", false ) )
{
curl_easy_setopt( curl_handle, CURLOPT_PROXY, FRAMEWORK->Settings->GetQuickStringValue( "Downloads.ProxyServer", "" )->c_str() );
curl_easy_setopt( curl_handle, CURLOPT_PROXYPORT, FRAMEWORK->Settings->GetQuickInteger64Value( "Downloads.ProxyPort", 8080 ) );
}
if( curl_easy_perform( curl_handle ) != 0 )
{
buffer->Clear();
}
curl_easy_cleanup( curl_handle );
if( !DownloadManager::AbortDownloads )
{
Event* fwEvent = new Event();
fwEvent->Type = EVENT_DOWNLOAD_COMPLETE;
fwEvent->Data.Download.URL = new std::string( threadData->URL->c_str() );
fwEvent->Data.Download.Contents = buffer;
FRAMEWORK->PushEvent( fwEvent );
}
if( thread != 0 )
{
al_destroy_thread( thread );
}
return 0;
}