ID 348068 - onDestroy callback is called twice on exit with Nuke11

Follow

Problem summary
When closing a comp or exiting Nuke, the onDestroy callback will be thrown twice.
This behaviour is new with Nuke11.0 and is regressive with Nuke10.5

This behaviour does not happen when deleting a node within the script, only on exit.

Steps to reproduce

1)  Open Nuke

2)  Create a Group node

3)  Copy/Paste the following into the Script Editor and execute it:

def onDestroy():
    node = nuke.thisNode()
    nuke.tprint(node.fullName())

nuke.addOnDestroy(onDestroy, nodeClass="Group")

4)  Close the comp through 'File -> Close Comp'

Result: Within your Terminal, you will receive two print statements, the expected result is one.

Workaround
Unknown. 

Reproduced by support

This bug has been reproduced in:
Nuke11.1v3 - Windows 7 - Mac10.13 - CentOS6.9
Nuke11.1v1 - Windows 7 - Mac10.13 - CentOS6.9
Nuke11.0v4 - Windows 7 - Mac10.13 - CentOS6.9
Nuke11.0v1 - Windows 7 - Mac10.13 - CentOS6.9 - Regression

Unable to reproduce bug in:
Nuke10.5v7 - Windows 7 - Mac10.13 - CentOS6.9

Earliest version tested
- This issue no longer appears in this version and has regressed

Expected behaviour
The onDestroy callback should be called once on exit

Actual behaviour
The callback is called twice, which may cause exceptions

    We're sorry to hear that

    Please tell us why