From 173db98e1cab25a4d895dda085e1df63f8de09b0 Mon Sep 17 00:00:00 2001 From: Jesse Talavera Date: Thu, 15 Aug 2024 11:35:11 -0400 Subject: [PATCH] Fix dead strings being given to the Wi-fi adapters settings --- src/libretro/config/config.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libretro/config/config.cpp b/src/libretro/config/config.cpp index 711d298..48f8a01 100644 --- a/src/libretro/config/config.cpp +++ b/src/libretro/config/config.cpp @@ -897,11 +897,13 @@ bool MelonDsDs::RegisterCoreOptions() noexcept { #ifdef HAVE_NETWORKING_DIRECT_MODE // holds on to strings used in dynamic options until we finish submitting the options to the frontend + // DO NOT move this into a deeper scope, or else the strings that the options point to will be destroyed + // ReSharper disable once CppTooWideScope + vector adapters; if (std::optional pcap = LibPCap::New(); pcap) { ZoneScopedN("MelonDsDs::config::set_core_options::init_adapter_options"); // If we successfully initialized PCap and got some adapters... vector availableAdapters = pcap->GetAdapters(); - vector adapters; retro_core_option_v2_definition* wifiAdapterOption = find_if(definitions.begin(), definitions.end(), [](const auto& def) { return string_is_equal(def.key, MelonDsDs::config::network::DIRECT_NETWORK_INTERFACE); });