mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
AK: Fix some WeakPtr copy constructor variants not copying the link
This commit is contained in:
@@ -91,7 +91,7 @@ public:
|
|||||||
{
|
{
|
||||||
object.do_while_locked([&](U* obj) {
|
object.do_while_locked([&](U* obj) {
|
||||||
if (obj)
|
if (obj)
|
||||||
obj->template make_weak_ptr<U>().take_link();
|
m_link = obj->template make_weak_ptr<U>().take_link();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ public:
|
|||||||
{
|
{
|
||||||
object.do_while_locked([&](U* obj) {
|
object.do_while_locked([&](U* obj) {
|
||||||
if (obj)
|
if (obj)
|
||||||
obj->template make_weak_ptr<U>().take_link();
|
m_link = obj->template make_weak_ptr<U>().take_link();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "Atomic.h"
|
#include "Atomic.h"
|
||||||
#include "RefCounted.h"
|
#include "RefCounted.h"
|
||||||
#include "RefPtr.h"
|
#include "RefPtr.h"
|
||||||
|
#include "StdLibExtras.h"
|
||||||
#ifdef KERNEL
|
#ifdef KERNEL
|
||||||
# include <Kernel/Arch/i386/CPU.h>
|
# include <Kernel/Arch/i386/CPU.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -52,7 +53,7 @@ class WeakLink : public RefCounted<WeakLink> {
|
|||||||
friend class WeakPtr;
|
friend class WeakPtr;
|
||||||
|
|
||||||
public:
|
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> strong_ref() const
|
||||||
{
|
{
|
||||||
RefPtr<T, PtrTraits> ref;
|
RefPtr<T, PtrTraits> ref;
|
||||||
|
|||||||
Reference in New Issue
Block a user