From ada1d4906e016f7b55ffd0e8f74a78b55d6a4694 Mon Sep 17 00:00:00 2001 From: Rummskartoffel Date: Sat, 15 Jan 2022 15:23:40 +0100 Subject: Assistant: Make Provider ref-counted --- Userland/Applications/Assistant/Providers.h | 2 +- Userland/Applications/Assistant/main.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Userland/Applications/Assistant/Providers.h b/Userland/Applications/Assistant/Providers.h index b50be49059..2469e912bc 100644 --- a/Userland/Applications/Assistant/Providers.h +++ b/Userland/Applications/Assistant/Providers.h @@ -128,7 +128,7 @@ private: RefPtr m_bitmap; }; -class Provider { +class Provider : public RefCounted { public: virtual ~Provider() = default; diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index 522e65a444..f58df60e4d 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -122,11 +122,11 @@ public: explicit Database(AppState& state) : m_state(state) { - m_providers.append(make()); - m_providers.append(make()); - m_providers.append(make()); - m_providers.append(make()); - m_providers.append(make()); + m_providers.append(make_ref_counted()); + m_providers.append(make_ref_counted()); + m_providers.append(make_ref_counted()); + m_providers.append(make_ref_counted()); + m_providers.append(make_ref_counted()); } Function)> on_new_results; @@ -176,7 +176,7 @@ private: AppState& m_state; - NonnullOwnPtrVector m_providers; + NonnullRefPtrVector m_providers; Threading::Mutex m_mutex; HashMap> m_result_cache; -- cgit v1.2.3