mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-28 13:52:07 -04:00
Fix macos crashing on hook enabling
This commit is contained in:
parent
80b5b20efb
commit
f89cdcd78a
3 changed files with 4 additions and 4 deletions
loader/src
|
@ -795,6 +795,7 @@ void Loader::Impl::provideNextMod(Mod* mod) {
|
|||
Mod* Loader::Impl::takeNextMod() {
|
||||
if (!m_nextMod) {
|
||||
m_nextMod = this->createInternalMod();
|
||||
log::debug("Created internal mod {}", m_nextMod->getName());
|
||||
}
|
||||
auto ret = m_nextMod;
|
||||
return ret;
|
||||
|
|
|
@ -520,8 +520,7 @@ bool Mod::Impl::depends(std::string const& id) const {
|
|||
|
||||
Result<> Mod::Impl::enableHook(Hook* hook) {
|
||||
auto res = hook->enable();
|
||||
if (res) m_hooks.push_back(hook);
|
||||
else {
|
||||
if (!res) {
|
||||
log::error("Can't enable hook {} for mod {}: {}", hook->getDisplayName(), m_info.id(), res.unwrapErr());
|
||||
}
|
||||
|
||||
|
@ -533,6 +532,7 @@ Result<> Mod::Impl::disableHook(Hook* hook) {
|
|||
}
|
||||
|
||||
Result<Hook*> Mod::Impl::addHook(Hook* hook) {
|
||||
m_hooks.push_back(hook);
|
||||
if (LoaderImpl::get()->isReadyToHook()) {
|
||||
if (hook->getAutoEnable()) {
|
||||
auto res = this->enableHook(hook);
|
||||
|
|
|
@ -152,7 +152,6 @@ $execute {
|
|||
}
|
||||
|
||||
int geodeEntry(void* platformData) {
|
||||
|
||||
// set up internal mod, settings and data
|
||||
auto internalSetupRes = LoaderImpl::get()->setupInternalMod();
|
||||
if (!internalSetupRes) {
|
||||
|
@ -178,7 +177,7 @@ int geodeEntry(void* platformData) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
log::debug("Set up loader");
|
||||
log::info("Set up loader");
|
||||
|
||||
// open console
|
||||
if (Mod::get()->getSettingValue<bool>("show-platform-console")) {
|
||||
|
|
Loading…
Add table
Reference in a new issue