summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Utilities/Sphinx/cmake.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py
index 5eb4eaca7d..0e8f2803b9 100644
--- a/Utilities/Sphinx/cmake.py
+++ b/Utilities/Sphinx/cmake.py
@@ -290,9 +290,12 @@ class CMakeDomain(Domain):
}
def clear_doc(self, docname):
+ to_clear = set()
for fullname, (fn, _) in self.data['objects'].items():
if fn == docname:
- del self.data['objects'][fullname]
+ to_clear.add(fullname)
+ for fullname in to_clear:
+ del self.data['objects'][fullname]
def resolve_xref(self, env, fromdocname, builder,
typ, target, node, contnode):