diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 5af93ab2f..7fdcfa2af 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -91,7 +91,7 @@ Application::Ptr Application::GetInstance(void) * * @returns false if we're shutting down, true otherwise. */ -bool Application::ProcessEvents(void) const +bool Application::ProcessEvents(void) { Object::ClearHeldObjects(); diff --git a/lib/base/application.h b/lib/base/application.h index 3ba1af3ce..fb92f5025 100644 --- a/lib/base/application.h +++ b/lib/base/application.h @@ -76,7 +76,7 @@ public: static String GetPkgDataDir(void); static void SetPkgDataDir(const String& path); - bool ProcessEvents(void) const; + static bool ProcessEvents(void); protected: void RunEventLoop(void) const; diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp index f22f611ab..e8b9de878 100644 --- a/lib/base/utility.cpp +++ b/lib/base/utility.cpp @@ -522,17 +522,7 @@ bool Utility::Glob(const String& pathSpec, const function& */ void Utility::WaitUntil(const function& predicate) { - while (!predicate()) { - Application::Ptr instance = Application::GetInstance(); - - /* Waiting for a predicate requires an application instance. - * This means we cannot do certain asynchronous things - * (like spawning a process) until the application instance - * has been initialized. */ - if (!instance) - BOOST_THROW_EXCEPTION(runtime_error("Waiting for predicate failed: Application instance is not initialized.")); - - instance->ProcessEvents(); - } + while (!predicate()) + Application::ProcessEvents(); }