From ee643ad2a5e8a1d964e43f9935836daec4995934 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 9 Apr 2021 01:03:30 +0100 Subject: Migrate IOHookProvider from reference<> to std::shared_ptr<>. --- include/iohook.h | 10 ++++++---- include/modules/ssl.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/iohook.h b/include/iohook.h index 986a5ba1f..83d752620 100644 --- a/include/iohook.h +++ b/include/iohook.h @@ -22,7 +22,9 @@ class StreamSocket; -class IOHookProvider : public refcountbase, public ServiceProvider +class IOHookProvider + : public std::enable_shared_from_this + , public ServiceProvider { const bool middlehook; @@ -70,12 +72,12 @@ class IOHook : public Cullable /** The IOHookProvider for this hook, contains information about the hook, * such as the module providing it and the hook type. */ - reference prov; + std::shared_ptr prov; /** Constructor * @param provider IOHookProvider that creates this object */ - IOHook(IOHookProvider* provider) + IOHook(std::shared_ptr provider) : prov(provider) { } /** @@ -132,7 +134,7 @@ class IOHookMiddle : public IOHook /** Constructor * @param provider IOHookProvider that creates this object */ - IOHookMiddle(IOHookProvider* provider) + IOHookMiddle(std::shared_ptr provider) : IOHook(provider) { } diff --git a/include/modules/ssl.h b/include/modules/ssl.h index 5aef29705..72f45bf69 100644 --- a/include/modules/ssl.h +++ b/include/modules/ssl.h @@ -204,7 +204,7 @@ class SSLIOHook : public IOHook return NULL; } - SSLIOHook(IOHookProvider* hookprov) + SSLIOHook(std::shared_ptr hookprov) : IOHook(hookprov) { } -- cgit v1.3.1-10-gc9f91