cnr-isti-vclab / corto

Mesh compression library, designed for rendering and speed.
Other
196 stars 43 forks source link

destroy objects in reverse order of dependency #31

Open ghost opened 2 years ago

ponchio commented 2 years ago

Hi Gernot, it is not clear to me what is the rationale behind this change, could you explain?

ghost commented 2 years ago

In some cases related to ply files, if the crt::MeshLoader object is destructed before the crt::Encoder object, an exception will be thrown. I haven't delved deeply into this, but the order of destruction seems to matter.

ponchio commented 2 years ago

I had a look at the code and found no plausible reason on why the destruction order should matter: the MeshLoader data is copied into Encoder (quantized actually). I made a test intentionally calling the destroyer but couldn't replicate the issue.

I guess the culprit is a wrong memory access problem somewhere else in the code. If I could manage to replicate it, I would rather find and fix the real problem. Which compiler where you using?

ghost commented 2 years ago

Apple clang version 13.0.0 (clang-1300.0.29.30)

ponchio commented 2 years ago

Hi ghost,

i made some tests in apple with clang, but with no luck: I can't replicate the issue.
Could you provide the model (and command line in case of options), or better, if you can, run valgrind?
Rabbid76 commented 2 years ago

This PR can be ignored an closed. The actual problem is PLY files with QUAD faces are not read correctly #32