mirror of https://github.com/aria2/aria2
Move GHR outside of function and provide ctor to suppress compiler warning
Without ctor, compiler emits warning "unused variable ghr".pull/119/head
parent
b6d84c0160
commit
c26c1e234a
|
@ -140,15 +140,20 @@ void executeCommand(std::deque<std::unique_ptr<Command>>& commands,
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
class GHR {
|
||||||
|
public:
|
||||||
|
GHR() {}
|
||||||
|
~GHR()
|
||||||
|
{
|
||||||
|
global::globalHaltRequested = 5;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // namespace
|
||||||
|
|
||||||
int DownloadEngine::run(bool oneshot)
|
int DownloadEngine::run(bool oneshot)
|
||||||
{
|
{
|
||||||
class GHR {
|
GHR ghr;
|
||||||
public:
|
|
||||||
~GHR() {
|
|
||||||
global::globalHaltRequested = 5;
|
|
||||||
}
|
|
||||||
} ghr;
|
|
||||||
|
|
||||||
while(!commands_.empty() || !routineCommands_.empty()) {
|
while(!commands_.empty() || !routineCommands_.empty()) {
|
||||||
if(!commands_.empty()) {
|
if(!commands_.empty()) {
|
||||||
waitData();
|
waitData();
|
||||||
|
|
Loading…
Reference in New Issue