From c14dfc766575f50297ddec5ad7d2a8bf8e072e33 Mon Sep 17 00:00:00 2001 From: Johan Engelen Date: Tue, 1 Jun 2010 23:17:09 +0200 Subject: [PATCH] i think this is the final fix for the LPE forking bug with clones. --- src/sp-lpe-item.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 77b2db6f6..71352ed98 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -814,6 +814,10 @@ bool sp_lpe_item_fork_path_effects_if_necessary(SPLPEItem *lpeitem, unsigned int // so that each object has its own independent copy of the effect. // Note: replacing path effects messes up the path effect list + // Clones of the LPEItem will increase the refcount of the lpeobjects. + // Therefore, nr_of_allowed_users should be increased with the number of clones (i.e. refs to the lpeitem) + nr_of_allowed_users += SP_OBJECT(lpeitem)->hrefcount; + std::vector old_lpeobjs, new_lpeobjs; PathEffectList effect_list = sp_lpe_item_get_effect_list(lpeitem); for (PathEffectList::iterator it = effect_list.begin(); it != effect_list.end(); it++) -- 2.30.2