DiscussionsIssue archiveDraw Harness and Samples

Archived discussion

OCCTProxy class cleanup crashes

Draw Harness and SamplesThu, 03/19/2015 - 08:291 reply

Browse this forum
QuestionAuthor

I've taken the OCCTProxy example (a C++ proxy class callable from CSharp) and converted it into a DLL interface that exposes a plain C interface for the viewer. The goal is to use OCCT's viewer from an older application that can only call C libraries, and that goal is working.

The OCCTProxy example does not have any destructor or cleanup. So I've attempted to implement one, based on allocations that happen in InitViewer(). But something is crashing. When I close my application's form (which calls the the destructor), the application crashes.

So my question is where to find good examples of how/when to cleanup all the instantiated in InitViewer(), and in what order to delete those classes safely.

Attached is the main source of my CProxy class and the extern'd C calls that wrap it.

Discussion

1 archived reply

Posts are displayed in their archived order.

01Author

Replying to my own post with other possibly pertinent details: using Visual Studio 2013, and OCCT 6.7.1, all compiled in a 32-bit build environment.