More memory leaks
Brought to you by:
franzg
The following code leaks about 77 bytes per loop (7664 kB after 100000 loops).
import clips
t = clips.BuildTemplate("foo", "")
while True:
f = t.BuildFact()
f.Assert()
f.Retract()
The following similar code does not leak:
import clips
while True:
f = clips.Assert("(foo)")
f.Retract()
Workaround:
If #define USE_NONASSERT_CLIPSGCLOCK is commented out in clipsmodule.h the memory is not leaked.
Apparently the problem is related to the hashtables used to track unasserted facts.
The reported memory leak occurs with pyclips 1.0.7.348.