Skip to content

Add optional Auto-cleanup code.

So for the auto-cleanup. I wish I had made it auto-cleanup from the beginning but now that there are a lot of users, I need to keep from breaking any of their code.

The State DVR will be easy to implement without breaking anyone. I can call the cleanup code right after the Event Handler is finished, (which as I said before, it will automatically stop if it has been orphaned), and I can suppress the error if it still called in the destructor (for those QControls that are already in use). This will probably cover 90% of the QControls out there.

For the other 10%, this is if the developer added their own references to the QControl private data. There is a dynamic dispatch VI that the developer is supposed to place their custom cleanup code. I can call this in the same place as above but because it is custom developer code, I cannot suppress an error if it is called again in a destructor.

Therefore, I could add a flag on the constructor asking if you want to automatically run the cleanup code without a destructor. The flag would have to default to FALSE to keep from breaking current users and would only automatically show in new QControls as I would have to add this to the wizard. Older QControls could still add it.