本文整理汇总了C++中Downloader::unref方法的典型用法代码示例。如果您正苦于以下问题:C++ Downloader::unref方法的具体用法?C++ Downloader::unref怎么用?C++ Downloader::unref使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Downloader
的用法示例。
在下文中一共展示了Downloader::unref方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDownloaderPolicy
void
MediaBase::OnPropertyChanged (PropertyChangedEventArgs *args, MoonError *error)
{
if (args->GetProperty ()->GetOwnerType() != Type::MEDIABASE) {
FrameworkElement::OnPropertyChanged (args, error);
return;
}
if (args->GetId () == MediaBase::SourceProperty) {
const char *uri = args->GetNewValue() ? args->GetNewValue()->AsString () : NULL;
if (IsAttached () && AllowDownloads ()) {
if (uri && *uri) {
Downloader *dl;
if ((dl = GetDeployment ()->CreateDownloader ())) {
dl->Open ("GET", uri, GetDownloaderPolicy (uri));
SetSource (dl, "");
dl->unref ();
} else {
// we're shutting down
}
} else {
SetSource (NULL, NULL);
}
} else {
source_changed = true;
}
InvalidateMeasure ();
}
NotifyListenersOfPropertyChange (args, error);
}
示例2:
void
MediaBase::SetSourceAsyncCallback ()
{
Downloader *downloader;
char *part_name;
DownloaderAbort ();
downloader = source.downloader;
part_name = source.part_name;
source.queued = false;
source.downloader = NULL;
source.part_name = NULL;
if (!IsAttached ())
return;
SetSourceInternal (downloader, part_name);
if (downloader)
downloader->unref ();
}