summaryrefslogtreecommitdiff
path: root/AK/Weakable.h
diff options
context:
space:
mode:
authorTom <tomut@yahoo.com>2020-12-29 18:11:12 -0700
committerAndreas Kling <kling@serenityos.org>2020-12-31 00:39:43 +0100
commit34b3d92a13f154d3560c79e16a2e370fddbf130e (patch)
tree0bdae292d8c039d52cf75ceb84ba07d9ca3b5e61 /AK/Weakable.h
parent54eeb8ee9a57850aca5056a5834bfb86a210bf1a (diff)
downloadserenity-34b3d92a13f154d3560c79e16a2e370fddbf130e.zip
AK: Fix some WeakPtr copy constructor variants not copying the link
Diffstat (limited to 'AK/Weakable.h')
-rw-r--r--AK/Weakable.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/AK/Weakable.h b/AK/Weakable.h
index e598895ac9..4db6e1344d 100644
--- a/AK/Weakable.h
+++ b/AK/Weakable.h
@@ -30,6 +30,7 @@
#include "Atomic.h"
#include "RefCounted.h"
#include "RefPtr.h"
+#include "StdLibExtras.h"
#ifdef KERNEL
# include <Kernel/Arch/i386/CPU.h>
#endif
@@ -52,7 +53,7 @@ class WeakLink : public RefCounted<WeakLink> {
friend class WeakPtr;
public:
- template<typename T, typename PtrTraits = RefPtrTraits<T>>
+ template<typename T, typename PtrTraits = RefPtrTraits<T>, typename EnableIf<IsBaseOf<RefCountedBase, T>::value>::Type* = nullptr>
RefPtr<T, PtrTraits> strong_ref() const
{
RefPtr<T, PtrTraits> ref;