
Fri, 10/08/2021 - 18:00
Forums:
//! Decrement reference counter and if 0, destroy referred object
void EndScope()
{
if (entity != 0 && entity->DecrementRefCounter() == 0)
entity->Delete();
entity = 0;
}
entity->Delete();
This line throws a null pointer on shutdown:
Exception thrown: read access violation.
this->entity-> was 0x7FFF4ECAF808.
I am using ver 7.5.0. This happens after I import a model and shut down the host application. I built a debug version and the call stack points to TKXSBase.dll Any ideas how to avoid the crash?
Fri, 10/08/2021 - 20:32
update:
I confirmed that changing the order of the files in CMakeLists.txt makes another one throw the same error - I think the library tires to dereference twice as they both unload.
if the order is TKXDESTEP;TKXSBase : TKXSBase throws the error. and if the order is reversed: TKXDESTEP throws the error.
Fri, 10/08/2021 - 22:35
You have forgotten to attach your call stack, as currently your message shows only a function from TKernel and used everywhere in OCCT.
What exactly does it mean? Are you loading some DLL's dynamically (how then?), or just call a straightforward code? How does library order may affect anything?
Sat, 10/09/2021 - 00:02
This forum is not relevant for this post. The right place is https://dev.opencascade.org/forums/data-exchange-and-application-framework.
Mon, 10/11/2021 - 16:47
Okay I will repost in that channel with further comments, thank you!