Open synacktiv-rj opened 1 year ago
I changed the way the context is allocated in my fork. Still waiting for my other two PRs to be merged though…
Hi there,
@synacktiv-rj: you're obviously right, and I can easily reproduce it when running the example_tenet
exe on a ~300MB trace.
@mrexodia : I've indeed been away from this repo for a few month, but I've since merged your cmake PR (thanks, again). If you still want to contribute to this repo, I would be happy to merge your context allocation changes.
Alright, I’ll try to upstream them. Locally I started a full rewrite, but obviously life got in the way and it didn’t get very far 😅
Hello,
A memory leak occurs in the loop used to call
ttdcursor.ReplayForward
, since the caller ofCursor::GetCrossPlatformContext
must free the context, and this is never done.Here, the previous context containing the allocation is overriden without beeing freeed:
https://github.com/commial/ttd-bindings/blob/fb836bdb738bf9170e73349994113c8a92f0feb8/example_tenet/main.cpp#L243
My quick fix to deal with this issue was:
I think the context should also be freed when this condition is true:
https://github.com/commial/ttd-bindings/blob/fb836bdb738bf9170e73349994113c8a92f0feb8/example_tenet/main.cpp#L239-L240
Rémi