mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-07 17:16:00 -05:00
Fix potential crashes when adding or removing macro segments
I wrongly assumed that std::deque would guarantee that pointers to elements in deque would not be invalidated by insert() or erase() but this is not the case it seems. "" An erase in the middle of the deque invalidates all the iterators and references to elements of the deque. An erase at either end of the deque invalidates only the iterators and the references to the erased elements. "" I guess I got lucky noone ran into these sorts of crashes for now?
This commit is contained in:
@@ -54,6 +54,8 @@ public:
|
||||
void HighlightCondition(int idx);
|
||||
void PopulateMacroActions(Macro &m, uint32_t afterIdx = 0);
|
||||
void PopulateMacroConditions(Macro &m, uint32_t afterIdx = 0);
|
||||
void SetActionData(Macro &m);
|
||||
void SetConditionData(Macro &m);
|
||||
void ConnectControlSignals(MacroActionEdit *);
|
||||
void ConnectControlSignals(MacroConditionEdit *);
|
||||
void SwapActions(Macro *m, int pos1, int pos2);
|
||||
|
||||
@@ -34,6 +34,7 @@ public:
|
||||
std::shared_ptr<MacroAction> * = nullptr,
|
||||
const std::string &id = "scene_switch");
|
||||
void UpdateEntryData(const std::string &id);
|
||||
void SetEntryData(std::shared_ptr<MacroAction> *);
|
||||
|
||||
private slots:
|
||||
void ActionSelectionChanged(const QString &text);
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
bool IsRootNode();
|
||||
void SetRootNode(bool);
|
||||
void UpdateEntryData(const std::string &id);
|
||||
void SetEntryData(std::shared_ptr<MacroCondition> *);
|
||||
|
||||
private slots:
|
||||
void LogicSelectionChanged(int idx);
|
||||
|
||||
Reference in New Issue
Block a user