mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-26 17:36:05 -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;
|
||||
|
||||
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::create(
|
||||
|
|
|
@ -39,9 +39,7 @@ Hook* Hook::Impl::create(
|
|||
auto impl = std::make_shared<Impl>(
|
||||
address, detour, displayName, handlerMetadata, hookMetadata
|
||||
);
|
||||
auto hook = new Hook(std::move(impl));
|
||||
impl->m_self = hook;
|
||||
return hook;
|
||||
return new Hook(std::move(impl));
|
||||
}
|
||||
|
||||
Result<> Hook::Impl::enable() {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
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::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>(
|
||||
address, readMemory(address, patch.size()), patch
|
||||
);
|
||||
auto p = new Patch(std::move(impl));
|
||||
impl->m_self = p;
|
||||
return p;
|
||||
return new Patch(std::move(impl));
|
||||
}
|
||||
|
||||
Result<> Patch::Impl::enable() {
|
||||
|
|
Loading…
Reference in a new issue