Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix a crash when running with --nosplash

Dmitry Kazakovf958483f6da4
diff --git a/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp b/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp
index 12beb98b78..8a09f3e72f 100644
--- a/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp
+++ b/plugins/platforms/wayland/waylandcolormanagement/KisWaylandSurfaceColorManager.cpp
@@ -40,7 +40,13 @@ std::shared_ptr<KisWaylandAPIColorManager> KisWaylandSurfaceColorManager::getOrC
if (s_waylandManager.exists()) {
result = s_waylandManager->lock();
- } else {
+ }
+
+ /**
+ * A weak pointer in `s_waylandManager` may have become released,
+ * so it may be null, even though the static itself is non-null.
+ */
+ if (!result) {
result.reset(new KisWaylandAPIColorManager());
*s_waylandManager = result;
}