Store references to callback objects to prevent garbage collection.