From 458a21953f73c6be27c45d0fdeb04200fbdb3ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 21 Jun 2026 14:07:09 +0200 Subject: [PATCH] Platform: clarify what happens to the view in Configuration::setTitle(). --- src/Magnum/Platform/GlfwApplication.h | 4 ++++ src/Magnum/Platform/Sdl2Application.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Magnum/Platform/GlfwApplication.h b/src/Magnum/Platform/GlfwApplication.h index 59b9a337a..87cc81b2d 100644 --- a/src/Magnum/Platform/GlfwApplication.h +++ b/src/Magnum/Platform/GlfwApplication.h @@ -1870,6 +1870,10 @@ class GlfwApplication::Configuration { * @return Reference to self (for method chaining) * * Default is @cpp "Magnum GLFW Application" @ce. + * @note The function makes a copy of the view if it's not not global + * or null-terminated, use the + * @link Corrade::Containers::Literals::StringLiterals::operator""_s() Containers::Literals::operator""_s() @endlink + * literal to prevent that where possible. */ Configuration& setTitle(Containers::StringView title) { _title = Containers::String::nullTerminatedGlobalView(title); diff --git a/src/Magnum/Platform/Sdl2Application.h b/src/Magnum/Platform/Sdl2Application.h index b022bff46..ea74731c0 100644 --- a/src/Magnum/Platform/Sdl2Application.h +++ b/src/Magnum/Platform/Sdl2Application.h @@ -2603,6 +2603,10 @@ class Sdl2Application::Configuration { * expected to be set by the HTML markup. However, it's possible * to change the page title later (for example in response to * application state change) using @ref setWindowTitle(). + * @note The function makes a copy of the view if it's not not global + * or null-terminated, use the + * @link Corrade::Containers::Literals::StringLiterals::operator""_s() Containers::Literals::operator""_s() @endlink + * literal to prevent that where possible. */ #if !defined(CORRADE_TARGET_EMSCRIPTEN) && !defined(CORRADE_TARGET_IOS) Configuration& setTitle(const Containers::StringView title) {