Workaround 2 FPC compilation problems, and a memory leak at LoadFromJSON #2
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
BeRo1985/pasgltf!2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi,
First of all, thanks for developing PasGLTF ! Great job ! I decided to use it as a basis for reading glTF in Castle Game Engine. We use PasGLTF unit and convert glTF to an X3D scene graph, which is something that Castle Game Engine can process and display. If you're interested, the complete unit in Castle Game Engine that uses PasGLTF is in here: https://github.com/castle-engine/castle-engine/blob/master/src/x3d/x3dloadinternalgltf.pas . I will announce news about it soon.
I found some small issues in PasGLTF that I managed to fix :)
Looks like FPC doesn't handle the fact that you have
TPasGLTF.TAccessor.TType,TPasGLTF.TSampler.TType,TPasGLTF.TCamera.TType.I workarounded it by renaming
TPasGLTF.TSampler.TType->TPasGLTF.TSampler.TSamplerType,TPasGLTF.TCamera.TType->TPasGLTF.TCamera.TCameraType.It looks uglier of course (using the name
TSamplerTypewithinTSamplerseems unnecessary), but at least it compiles with FPC with debug information now.WARNING: This workaround does change the public PasGLTF API. If any code is using the
TSampler.TTypeorTCamera.TType, it will have to be adjusted now. I have adjusted the included viewer such that it compiles.They are around two
System.Move(@fItems[...], @fItems[...], ...)calls. I workaround them using MoveSrc, MoveDst variables.test_gltf_read.lpr, compile it with -gh (HeapTrc unit from FPC).test_gltf_read.lpr.txt
The reason is that you call
LoadFromJSON(TPasJSON.Parse(...)), andTPasJSON.Parsecreates a new instance of TPasJSONItem. But it is never freed.LoadFromJSONdoesn't free it.You should post the dbginfo issues with TType and the Move issues rather into the FPC bug tracker at https://bugs.freepascal.org/ instead to me :-) so this part => wontfix (since it are issues at FPC itself)
And the memory leak issue is fixed now. so this part => fixed
Sure, I wanted to post the 2 issues as FPC bugs of course :) In the meantime, I need to have PasGLTF working, with FPC 3.0.4, so I'll carry these workarounds in my PasGLTF copy.
Pull request closed