Skip to content
Extraits de code Groupes Projets
Valider aa998855 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Fix crash on empty progress title on OS X

parent 152862a5
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -137,7 +137,7 @@ std::pair<size_t, size_t> ifind(std::string const& haystack, std::string const& ...@@ -137,7 +137,7 @@ std::pair<size_t, size_t> ifind(std::string const& haystack, std::string const&
#ifndef __APPLE__ #ifndef __APPLE__
namespace osx { namespace osx {
AppNapDisabler::AppNapDisabler(std::string const& reason) { } AppNapDisabler::AppNapDisabler(std::string reason) { }
AppNapDisabler::~AppNapDisabler() { } AppNapDisabler::~AppNapDisabler() { }
} }
#endif #endif
......
...@@ -35,7 +35,7 @@ namespace agi { ...@@ -35,7 +35,7 @@ namespace agi {
class AppNapDisabler { class AppNapDisabler {
void *handle; void *handle;
public: public:
AppNapDisabler(std::string const& reason); AppNapDisabler(std::string reason);
~AppNapDisabler(); ~AppNapDisabler();
}; };
} }
......
...@@ -29,7 +29,8 @@ static std::string EmptyIfNil(NSString *string) { ...@@ -29,7 +29,8 @@ static std::string EmptyIfNil(NSString *string) {
namespace agi { namespace agi {
namespace osx { namespace osx {
AppNapDisabler::AppNapDisabler(std::string const& reason) : handle(nullptr) { AppNapDisabler::AppNapDisabler(std::string reason) : handle(nullptr) {
if (reason.empty()) reason = "Loading";
auto processInfo = [NSProcessInfo processInfo]; auto processInfo = [NSProcessInfo processInfo];
if ([processInfo respondsToSelector:@selector(beginActivityWithOptions:reason:)]) if ([processInfo respondsToSelector:@selector(beginActivityWithOptions:reason:)])
handle = [[processInfo beginActivityWithOptions:NSActivityUserInitiatedAllowingIdleSystemSleep handle = [[processInfo beginActivityWithOptions:NSActivityUserInitiatedAllowingIdleSystemSleep
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter