20 lines
929 B
Diff
20 lines
929 B
Diff
|
Fix a crash when running tests. Source:
|
||
|
https://github.com/synfig/synfig/pull/2265
|
||
|
https://github.com/synfig/synfig/commit/61a290b1aaf58366149662ae0ad224127711aea8
|
||
|
|
||
|
--- a/src/synfigapp/actions/layerduplicate.cpp 2021-07-12 17:45:50.000000000 +0200
|
||
|
+++ b/src/synfigapp/actions/layerduplicate.cpp 2021-08-15 11:52:47.878894610 +0200
|
||
|
@@ -417,7 +417,11 @@
|
||
|
|
||
|
auto cloned_layer = layer_pair.second;
|
||
|
|
||
|
- for(auto iter=cloned_layer->dynamic_param_list().cbegin();iter!=cloned_layer->dynamic_param_list().cend();++iter)
|
||
|
+ // disconnect_dynamic_param/connect_dynamic_param can change dynamic_param_list() while iterating
|
||
|
+ // which makes iter invalid, so we create a copy of dynamic_param_list() first
|
||
|
+ auto param_list = cloned_layer->dynamic_param_list();
|
||
|
+
|
||
|
+ for (auto iter=param_list.cbegin();iter!=param_list.cend();++iter)
|
||
|
{
|
||
|
for (const auto& vn_pair : cloned_valuenode_map) {
|
||
|
if (iter->second == vn_pair.first) {
|