From f310913da57d66412db692123bdec5d142c64248 Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Wed, 22 Jul 2026 20:15:10 -0400 Subject: [PATCH] fix(persist): call MarkProjectDirty after every SetProjExtState write After capture, saveToActiveProject wrote ext state but left the project clean, so Ctrl+S was a no-op and the bank was silently lost on close. Also flushes the Save-As re-GUID on the normal save flow. --- src/persist.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/persist.cpp b/src/persist.cpp index 1d6c793..5016b14 100644 --- a/src/persist.cpp +++ b/src/persist.cpp @@ -54,6 +54,7 @@ #define REAPERAPI_MINIMAL #define REAPERAPI_WANT_EnumProjects #define REAPERAPI_WANT_GetProjExtState +#define REAPERAPI_WANT_MarkProjectDirty #define REAPERAPI_WANT_SetProjExtState #define REAPERAPI_WANT_ShowConsoleMsg #define REAPERAPI_WANT_genGuid @@ -162,6 +163,7 @@ void ReaSamplerSession::saveToActiveProject() { const std::string json = bank_.serialize(); SetProjExtState(static_cast(proj), kProjExtNamespace, kProjExtIndexKey, json.c_str()); + MarkProjectDirty(static_cast(proj)); } void ReaSamplerSession::loadFromProject(void* proj, const std::string& projectDir) { @@ -266,11 +268,13 @@ void ReaSamplerSession::poll() { // Save-As duplicated our ext state, so the new project B currently // shares A's GUID. Mint a FRESH GUID for B and write it, so A and B // no longer collide on identity when reopened later. Adopt the fresh - // GUID as our last-seen identity. + // GUID as our last-seen identity. Mark dirty so the fresh GUID flushes + // to the new .rpp on the next normal save / close-prompt. const std::string fresh = genProjectGuidString(); if (proj) { SetProjExtState(static_cast(proj), kProjExtNamespace, kProjExtGuidKey, fresh.c_str()); + MarkProjectDirty(static_cast(proj)); } lastGuid_ = fresh; lastRppPath_ = rppPath;