dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 58 forks source link

Move createHandle’s destroy from context to a flag #391

Closed pottedmeat closed 6 years ago

pottedmeat commented 6 years ago

Type: bug

The following has been addressed in the PR:

Description:

If the destroy function in the response object from createHandle was called in a different context than the original, destroy would be assigned to the call object and the destructor function would also be called in that context. By using a flag, we can guarantee the destructor is only called once regardless of associated context.