mirror of
https://github.com/geode-sdk/geode.git
synced 2025-02-18 09:10:17 -05:00
fix crash yayy
This commit is contained in:
parent
7631b045e1
commit
ab436bd7c3
4 changed files with 4 additions and 8 deletions
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
using namespace geode::prelude;
|
using namespace geode::prelude;
|
||||||
|
|
||||||
Hook::Hook(std::shared_ptr<Impl>&& impl) : m_impl(std::move(impl)) {}
|
Hook::Hook(std::shared_ptr<Impl>&& impl) : m_impl(std::move(impl)) { m_impl->m_self = this; }
|
||||||
Hook::~Hook() = default;
|
Hook::~Hook() = default;
|
||||||
|
|
||||||
Hook* Hook::create(
|
Hook* Hook::create(
|
||||||
|
|
|
@ -39,9 +39,7 @@ Hook* Hook::Impl::create(
|
||||||
auto impl = std::make_shared<Impl>(
|
auto impl = std::make_shared<Impl>(
|
||||||
address, detour, displayName, handlerMetadata, hookMetadata
|
address, detour, displayName, handlerMetadata, hookMetadata
|
||||||
);
|
);
|
||||||
auto hook = new Hook(std::move(impl));
|
return new Hook(std::move(impl));
|
||||||
impl->m_self = hook;
|
|
||||||
return hook;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<> Hook::Impl::enable() {
|
Result<> Hook::Impl::enable() {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
using namespace geode::prelude;
|
using namespace geode::prelude;
|
||||||
|
|
||||||
Patch::Patch(std::shared_ptr<Impl>&& impl) : m_impl(std::move(impl)) {}
|
Patch::Patch(std::shared_ptr<Impl>&& impl) : m_impl(std::move(impl)) { m_impl->m_self = this; }
|
||||||
Patch::~Patch() = default;
|
Patch::~Patch() = default;
|
||||||
|
|
||||||
Patch* Patch::create(void* address, const ByteVector& patch) {
|
Patch* Patch::create(void* address, const ByteVector& patch) {
|
||||||
|
|
|
@ -35,9 +35,7 @@ Patch* Patch::Impl::create(void* address, const geode::ByteVector& patch) {
|
||||||
auto impl = std::make_shared<Impl>(
|
auto impl = std::make_shared<Impl>(
|
||||||
address, readMemory(address, patch.size()), patch
|
address, readMemory(address, patch.size()), patch
|
||||||
);
|
);
|
||||||
auto p = new Patch(std::move(impl));
|
return new Patch(std::move(impl));
|
||||||
impl->m_self = p;
|
|
||||||
return p;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<> Patch::Impl::enable() {
|
Result<> Patch::Impl::enable() {
|
||||||
|
|
Loading…
Reference in a new issue