From 51936d4e2be6909eee281fc8a517f299c67ceb4e Mon Sep 17 00:00:00 2001 From: ajwerner Date: Tue, 8 Oct 2024 09:19:46 -0400 Subject: [PATCH] frida-gum::interceptor: impl Clone for Listener (#166) --- frida-gum/src/interceptor.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frida-gum/src/interceptor.rs b/frida-gum/src/interceptor.rs index 27d68e0..c1e7c4f 100644 --- a/frida-gum/src/interceptor.rs +++ b/frida-gum/src/interceptor.rs @@ -263,3 +263,10 @@ impl Drop for Listener { unsafe { frida_gum_sys::g_object_unref(*ptr) } } } + +impl Clone for Listener { + fn clone(&self) -> Self { + let Self(NativePointer(ptr)) = self; + Self(NativePointer(unsafe { frida_gum_sys::g_object_ref(*ptr) })) + } +}