diff --git a/gdext/src/Context.cpp b/gdext/src/Context.cpp index 9b1537e..3e01340 100644 --- a/gdext/src/Context.cpp +++ b/gdext/src/Context.cpp @@ -187,14 +187,13 @@ void RebuildFontAtlas() void SetIniFilename(const String& fn) { ImGuiIO& io = ImGui::GetIO(); - static std::vector iniFilename; if (fn.length() > 0) { std::string globalfn = ProjectSettings::get_singleton()->globalize_path(fn).utf8().get_data(); - iniFilename.resize(globalfn.length() + 1); - std::copy(globalfn.begin(), globalfn.end(), iniFilename.begin()); - iniFilename.back() = '\0'; - io.IniFilename = iniFilename.data(); + ctx->iniFilename.resize(globalfn.length() + 1); + std::copy(globalfn.begin(), globalfn.end(), ctx->iniFilename.begin()); + ctx->iniFilename.back() = '\0'; + io.IniFilename = ctx->iniFilename.data(); } else io.IniFilename = nullptr; diff --git a/gdext/src/Context.h b/gdext/src/Context.h index ead82d4..fdbf268 100644 --- a/gdext/src/Context.h +++ b/gdext/src/Context.h @@ -53,6 +53,7 @@ struct Context Vector2i viewportSize; ImGuiLayer* layer = nullptr; bool inProcessFrame = false; + std::vector iniFilename; Context(std::unique_ptr r); ~Context();