From fb6d998d4319d4463cc1fbd97aaa4b2bbfd1dae9 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 16 Nov 2014 04:28:14 +0200 Subject: [PATCH] Memory watch fixes - Fix editing existing watch - Fix saving watch on rename in project context --- src/core/memorywatch.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/memorywatch.cpp b/src/core/memorywatch.cpp index 026fc1f2..2de0a404 100644 --- a/src/core/memorywatch.cpp +++ b/src/core/memorywatch.cpp @@ -491,6 +491,12 @@ bool memwatch_set::rename(const std::string& oldname, const std::string& newname nitems.erase(oldname); rebuild(nitems); std::swap(items, nitems); + auto pr = project.get(); + if(pr) { + pr->watches.erase(oldname); + pr->watches[newname] = get_string(newname); + pr->flush(); + } fbuf.redraw_framebuffer(); return true; } @@ -498,6 +504,7 @@ bool memwatch_set::rename(const std::string& oldname, const std::string& newname void memwatch_set::set(const std::string& name, memwatch_item& item) { std::map nitems = items; + nitems.erase(name); //Insert does not insert if already existing. nitems.insert(std::make_pair(name, item)); rebuild(nitems); std::swap(items, nitems); -- 2.11.4.GIT