mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-22 12:59:07 -06:00
Cancel version check when application closes
This commit is contained in:
@@ -42,6 +42,7 @@ public:
|
||||
};
|
||||
|
||||
void requestLatestVersion(const std::string& url);
|
||||
void cancel();
|
||||
bool hasLatestVersionInfo();
|
||||
SemanticVersion latestVersion();
|
||||
|
||||
|
||||
@@ -806,6 +806,7 @@ void OpenSpaceEngine::deinitialize() {
|
||||
);
|
||||
}
|
||||
global::sessionRecording.deinitialize();
|
||||
global::versionChecker.cancel();
|
||||
|
||||
global::deinitialize();
|
||||
|
||||
|
||||
@@ -53,6 +53,15 @@ void VersionChecker::requestLatestVersion(const std::string& url) {
|
||||
_request->start(opt);
|
||||
}
|
||||
|
||||
void VersionChecker::cancel() {
|
||||
if (!_request) {
|
||||
return;
|
||||
}
|
||||
_request->cancel();
|
||||
_request->wait();
|
||||
_request = nullptr;
|
||||
}
|
||||
|
||||
bool VersionChecker::hasLatestVersionInfo() {
|
||||
if (_latestVersion.has_value()) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user