Adds dispose to XCallback