Prevents hitting callback when the instance was released

Fixes #2284

/cc @aerych