summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibGUI/GDirectoryModel.cpp2
-rw-r--r--Libraries/LibGUI/GIcon.cpp2
-rw-r--r--Libraries/LibGUI/GIcon.h3
3 files changed, 4 insertions, 3 deletions
diff --git a/Libraries/LibGUI/GDirectoryModel.cpp b/Libraries/LibGUI/GDirectoryModel.cpp
index 2db018b97f..7d11c021f5 100644
--- a/Libraries/LibGUI/GDirectoryModel.cpp
+++ b/Libraries/LibGUI/GDirectoryModel.cpp
@@ -149,7 +149,7 @@ GIcon GDirectoryModel::icon_for(const Entry& entry) const
LOCKER(thumbnail_cache().lock());
auto it = thumbnail_cache().resource().find(path);
if (it != thumbnail_cache().resource().end()) {
- entry.thumbnail = (*it).value.copy_ref();
+ entry.thumbnail = (*it).value;
} else {
thumbnail_cache().resource().set(path, nullptr);
}
diff --git a/Libraries/LibGUI/GIcon.cpp b/Libraries/LibGUI/GIcon.cpp
index 02ba6355ce..1d82735375 100644
--- a/Libraries/LibGUI/GIcon.cpp
+++ b/Libraries/LibGUI/GIcon.cpp
@@ -11,7 +11,7 @@ GIcon::GIcon(const GIconImpl& impl)
}
GIcon::GIcon(const GIcon& other)
- : m_impl(other.m_impl.copy_ref())
+ : m_impl(other.m_impl)
{
}
diff --git a/Libraries/LibGUI/GIcon.h b/Libraries/LibGUI/GIcon.h
index b8222ae7f3..2aecd7f2ed 100644
--- a/Libraries/LibGUI/GIcon.h
+++ b/Libraries/LibGUI/GIcon.h
@@ -29,7 +29,8 @@ public:
GIcon& operator=(const GIcon& other)
{
- m_impl = other.m_impl.copy_ref();
+ if (this != &other)
+ m_impl = other.m_impl;
return *this;
}