[vreg] (re)build entity classes cache after registry initialization. stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Apr 2013 14:40:09 +0200
branchstable
changeset 8913 409ea1ed9832
parent 8910 7652c3d46ba3
child 8914 e80dfffc2c2a
[vreg] (re)build entity classes cache after registry initialization. This fix potential memory fragmentation issue. Closes #2719113
cwvreg.py
--- a/cwvreg.py	Wed Apr 24 14:45:13 2013 +0200
+++ b/cwvreg.py	Wed Apr 24 14:40:09 2013 +0200
@@ -297,6 +297,10 @@
         super(ETypeRegistry, self).initialization_completed()
         # clear etype cache if you don't want to run into deep weirdness
         self.clear_caches()
+        # rebuild all classes to avoid potential memory fragmentation
+        # (see #2719113)
+        for eschema in self.vreg.schema.entities():
+            self.etype_class(eschema)
 
     def register(self, obj, **kwargs):
         obj = related_appobject(obj)