Reset SQRLUpdater when setFeedURL is called
This commit is contained in:
parent
a3786f66c9
commit
26c4fc34cb
1 changed files with 21 additions and 22 deletions
|
@ -38,12 +38,14 @@ void AutoUpdater::SetFeedURL(const std::string& feed,
|
|||
NSURL* url = [NSURL URLWithString:base::SysUTF8ToNSString(feed)];
|
||||
NSMutableURLRequest* urlRequest = [NSMutableURLRequest requestWithURL:url];
|
||||
|
||||
for (auto&& it : requestHeaders) {
|
||||
for (const auto& it : requestHeaders) {
|
||||
[urlRequest setValue:base::SysUTF8ToNSString(it.second)
|
||||
forHTTPHeaderField:base::SysUTF8ToNSString(it.first)];
|
||||
}
|
||||
|
||||
if (g_updater == nil) {
|
||||
if (g_updater)
|
||||
[g_updater release];
|
||||
|
||||
// Initialize the SQRLUpdater.
|
||||
@try {
|
||||
g_updater = [[SQRLUpdater alloc] initWithUpdateRequest:urlRequest];
|
||||
|
@ -63,9 +65,6 @@ void AutoUpdater::SetFeedURL(const std::string& feed,
|
|||
delegate->OnUpdateAvailable();
|
||||
});
|
||||
}];
|
||||
} else {
|
||||
g_updater.updateRequest = urlRequest;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
Loading…
Reference in a new issue