sw/source/uibase/uiview/uivwimp.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+)
New commits: commit 637538a9957af5deb69e6677af7c1d62cdaf3eb2 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Jul 11 22:42:58 2017 +0200 Related: tdf#107976 SwView_Impl::AddTransferable: remove dead weak references So that the vector doesn't grow till document close without a reason. Change-Id: Iec06e47e39274df7de46c971692054f4f0bcbc96 Reviewed-on: https://gerrit.libreoffice.org/39840 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Jenkins <c...@libreoffice.org> diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index 2ab3dfd58c41..f3f951669ca9 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -226,6 +226,16 @@ void SwView_Impl::AddTransferable(SwTransferable& rTransferable) //prevent removing of the non-referenced SwTransferable rTransferable.m_refCount++; { + // Remove previously added, but no longer existing weak references. + for (auto it = mxTransferables.begin(); it != mxTransferables.end();) + { + uno::Reference<lang::XUnoTunnel> xTunnel(it->get(), uno::UNO_QUERY); + if (!xTunnel.is()) + it = mxTransferables.erase(it); + else + ++it; + } + mxTransferables.push_back(uno::WeakReference<lang::XUnoTunnel>(uno::Reference<lang::XUnoTunnel>(&rTransferable))); } rTransferable.m_refCount--; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits