corto icon indicating copy to clipboard operation
corto copied to clipboard

destroy objects in reverse order of dependency

Open ghost opened this issue 2 years ago • 6 comments

ghost avatar Jan 20 '22 09:01 ghost

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

ponchio avatar Jan 20 '22 11:01 ponchio

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.

ghost avatar Jan 20 '22 11:01 ghost

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?

ponchio avatar Jan 20 '22 18:01 ponchio

Apple clang version 13.0.0 (clang-1300.0.29.30)

ghost avatar Jan 20 '22 18:01 ghost

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?

ponchio avatar Jan 21 '22 17:01 ponchio

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

Rabbid76 avatar Jan 21 '22 19:01 Rabbid76